Warning, file /pim/mailcommon/src/snippets/autotests/snippetcustomfileattachmentnamewidgettest.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-or-later 0005 */ 0006 0007 #include "snippetcustomfileattachmentnamewidgettest.h" 0008 #include "snippets/snippetcustomfileattachmentnamewidget.h" 0009 #include <QLineEdit> 0010 #include <QPushButton> 0011 #include <QTest> 0012 #include <QVBoxLayout> 0013 QTEST_MAIN(SnippetCustomFileAttachmentNameWidgetTest) 0014 0015 SnippetCustomFileAttachmentNameWidgetTest::SnippetCustomFileAttachmentNameWidgetTest(QObject *parent) 0016 : QObject(parent) 0017 { 0018 } 0019 0020 void SnippetCustomFileAttachmentNameWidgetTest::shouldHaveDefaultValues() 0021 { 0022 MailCommon::SnippetCustomFileAttachmentNameWidget w; 0023 auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout")); 0024 QVERIFY(mainLayout); 0025 QCOMPARE(mainLayout->contentsMargins(), QMargins(0, 0, 0, 0)); 0026 0027 auto mLineEdit = w.findChild<QLineEdit *>(QStringLiteral("mLineEdit")); 0028 QVERIFY(mLineEdit); 0029 QVERIFY(mLineEdit->text().isEmpty()); 0030 0031 auto selectVariable = w.findChild<QPushButton *>(QStringLiteral("selectVariable")); 0032 QVERIFY(selectVariable); 0033 QVERIFY(!selectVariable->text().isEmpty()); 0034 QVERIFY(selectVariable->menu()); 0035 } 0036 0037 #include "moc_snippetcustomfileattachmentnamewidgettest.cpp"