Warning, file /pim/mailcommon/src/snippets/autotests/snippetselectattachmentdialogtest.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002    SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #include "snippetselectattachmentdialogtest.h"
0008 #include "snippets/snippetselectattachmentdialog.h"
0009 #include "snippets/snippetselectattachmentwidget.h"
0010 #include <QDialogButtonBox>
0011 #include <QTest>
0012 #include <QVBoxLayout>
0013 QTEST_MAIN(SnippetSelectAttachmentDialogTest)
0014 
0015 SnippetSelectAttachmentDialogTest::SnippetSelectAttachmentDialogTest(QObject *parent)
0016     : QObject(parent)
0017 {
0018 }
0019 
0020 void SnippetSelectAttachmentDialogTest::shouldHaveDefaultValues()
0021 {
0022     MailCommon::SnippetSelectAttachmentDialog dlg;
0023     QVERIFY(!dlg.windowTitle().isEmpty());
0024 
0025     auto mainLayout = dlg.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
0026     QVERIFY(mainLayout);
0027 
0028     auto mAttachmentWidget = dlg.findChild<MailCommon::SnippetSelectAttachmentWidget *>(QStringLiteral("attachmentwidget"));
0029     QVERIFY(mAttachmentWidget);
0030 
0031     auto buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("button"));
0032     QVERIFY(buttonBox);
0033     QCOMPARE(buttonBox->standardButtons(), QDialogButtonBox::StandardButtons{QDialogButtonBox::Ok | QDialogButtonBox::Cancel});
0034 }
0035 
0036 #include "moc_snippetselectattachmentdialogtest.cpp"