File indexing completed on 2024-06-09 04:59:04

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "channelsearchnamelineresultwidgettest.h"
0008 #include "dialogs/channelsearchnamelineresultwidget.h"
0009 #include <QHBoxLayout>
0010 #include <QLabel>
0011 #include <QTest>
0012 #include <QToolButton>
0013 QTEST_MAIN(ChannelSearchNameLineResultWidgetTest)
0014 
0015 ChannelSearchNameLineResultWidgetTest::ChannelSearchNameLineResultWidgetTest(QObject *parent)
0016     : QObject(parent)
0017 {
0018 }
0019 
0020 void ChannelSearchNameLineResultWidgetTest::shouldHaveDefaultValues()
0021 {
0022     ChannelSearchNameLineResultWidget w;
0023     auto mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainLayout"));
0024     QVERIFY(mainLayout);
0025     QCOMPARE(mainLayout->contentsMargins(), QMargins{});
0026 
0027     auto mLabel = w.findChild<QLabel *>(QStringLiteral("mLabel"));
0028     QVERIFY(mLabel);
0029     QVERIFY(mLabel->text().isEmpty());
0030 
0031     auto mClearToolButton = w.findChild<QToolButton *>(QStringLiteral("mClearToolButton"));
0032     QVERIFY(mClearToolButton);
0033     QVERIFY(!mClearToolButton->toolTip().isEmpty());
0034 }
0035 
0036 #include "moc_channelsearchnamelineresultwidgettest.cpp"