File indexing completed on 2024-11-24 04:43:01

0001 /*
0002    SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "gravatarupdatedialogtest.h"
0008 #include "../widgets/gravatarupdatedialog.h"
0009 #include "../widgets/gravatarupdatewidget.h"
0010 #include <QDialogButtonBox>
0011 #include <QStandardPaths>
0012 #include <QTest>
0013 
0014 GravatarUpdateDialogTest::GravatarUpdateDialogTest(QObject *parent)
0015     : QObject(parent)
0016 {
0017     QStandardPaths::setTestModeEnabled(true);
0018 }
0019 
0020 GravatarUpdateDialogTest::~GravatarUpdateDialogTest() = default;
0021 
0022 void GravatarUpdateDialogTest::shouldHaveDefaultValue()
0023 {
0024     KABGravatar::GravatarUpdateDialog dlg;
0025     auto w = dlg.findChild<KABGravatar::GravatarUpdateWidget *>(QStringLiteral("gravatarupdatewidget"));
0026     QVERIFY(w);
0027 
0028     auto buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
0029     QVERIFY(buttonBox);
0030 
0031     QVERIFY(!dlg.saveUrl());
0032 }
0033 
0034 QTEST_MAIN(GravatarUpdateDialogTest)
0035 
0036 #include "moc_gravatarupdatedialogtest.cpp"