File indexing completed on 2024-11-17 04:51:16

0001 /*
0002    SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "snippetcustomfileattachmentnamedialogtest.h"
0008 #include "snippets/snippetcustomfileattachmentnamedialog.h"
0009 #include "snippets/snippetcustomfileattachmentnamewidget.h"
0010 #include <QDialogButtonBox>
0011 #include <QTest>
0012 #include <QVBoxLayout>
0013 QTEST_MAIN(SnippetCustomFileAttachmentNameDialogTest)
0014 
0015 SnippetCustomFileAttachmentNameDialogTest::SnippetCustomFileAttachmentNameDialogTest(QObject *parent)
0016     : QObject(parent)
0017 {
0018 }
0019 
0020 void SnippetCustomFileAttachmentNameDialogTest::shouldHaveDefaultValues()
0021 {
0022     MailCommon::SnippetCustomFileAttachmentNameDialog dlg;
0023     auto mainLayout = dlg.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
0024     QVERIFY(mainLayout);
0025 
0026     QVERIFY(!dlg.windowTitle().isEmpty());
0027 
0028     auto mCustomWidget = dlg.findChild<MailCommon::SnippetCustomFileAttachmentNameWidget *>(QStringLiteral("mCustomWidget"));
0029     QVERIFY(mCustomWidget);
0030     mainLayout->addWidget(mCustomWidget);
0031 
0032     auto buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("button"));
0033     QVERIFY(buttonBox);
0034     QCOMPARE(buttonBox->standardButtons(), QDialogButtonBox::StandardButtons{QDialogButtonBox::Ok | QDialogButtonBox::Cancel});
0035 }
0036 
0037 #include "moc_snippetcustomfileattachmentnamedialogtest.cpp"