Warning, file /pim/mailcommon/src/snippets/autotests/snippetattachmentwidgettest.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 "snippetattachmentwidgettest.h"
0008 #include "snippets/snippetattachmentwidget.h"
0009 #include <QHBoxLayout>
0010 #include <QLineEdit>
0011 #include <QTest>
0012 #include <QToolButton>
0013 QTEST_MAIN(SnippetAttachmentWidgetTest)
0014 
0015 SnippetAttachmentWidgetTest::SnippetAttachmentWidgetTest(QObject *parent)
0016     : QObject(parent)
0017 {
0018 }
0019 
0020 void SnippetAttachmentWidgetTest::shouldHaveDefaultValues()
0021 {
0022     MailCommon::SnippetAttachmentWidget w;
0023 
0024     auto layout = w.findChild<QHBoxLayout *>(QStringLiteral("layout"));
0025     QVERIFY(layout);
0026     QCOMPARE(layout->contentsMargins(), QMargins(0, 0, 0, 0));
0027 
0028     auto mLineEdit = w.findChild<QLineEdit *>(QStringLiteral("lineedit"));
0029     QVERIFY(mLineEdit);
0030     QVERIFY(mLineEdit->text().isEmpty());
0031     QVERIFY(mLineEdit->isReadOnly());
0032     QVERIFY(!mLineEdit->placeholderText().isEmpty());
0033 
0034     auto button = w.findChild<QToolButton *>(QStringLiteral("button"));
0035     QVERIFY(button);
0036     QVERIFY(!button->text().isEmpty());
0037     QVERIFY(!button->toolTip().isEmpty());
0038 }
0039 
0040 #include "moc_snippetattachmentwidgettest.cpp"