File indexing completed on 2024-05-26 05:05:58

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 "otrwidgettest.h"
0008 #include "otr/otrwidget.h"
0009 #include <QAction>
0010 #include <QTest>
0011 QTEST_MAIN(OtrWidgetTest)
0012 OtrWidgetTest::OtrWidgetTest(QObject *parent)
0013     : QObject{parent}
0014 {
0015 }
0016 
0017 void OtrWidgetTest::shouldHaveDefaultValues()
0018 {
0019     OtrWidget w;
0020     w.show();
0021     // QVERIFY(!w.isVisible());
0022     QVERIFY(!w.isCloseButtonVisible());
0023     QCOMPARE(w.messageType(), KMessageWidget::Information);
0024 
0025     auto endOtrAction = w.findChild<QAction *>(QStringLiteral("endOtrAction"));
0026     QVERIFY(endOtrAction);
0027     QVERIFY(!endOtrAction->text().isEmpty());
0028 
0029     auto refreshKeysAction = w.findChild<QAction *>(QStringLiteral("refreshKeysAction"));
0030     QVERIFY(refreshKeysAction);
0031     QVERIFY(!refreshKeysAction->text().isEmpty());
0032 }
0033 
0034 #include "moc_otrwidgettest.cpp"