Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 0ad993bd authored by Laurent Montel's avatar Laurent Montel 😁

Add autotests

parent fe0a5361
......@@ -18,7 +18,13 @@
*/
#include "confirmaddressemailentrydialogtest.h"
#include "../confirmaddressemailentrydialog.h"
#include <EmailValidator>
#include <QDialogButtonBox>
#include <QLabel>
#include <QLineEdit>
#include <QTest>
#include <QVBoxLayout>
QTEST_MAIN(ConfirmAddressEmailEntryDialogTest)
......@@ -27,3 +33,24 @@ ConfirmAddressEmailEntryDialogTest::ConfirmAddressEmailEntryDialogTest(QObject *
{
}
void ConfirmAddressEmailEntryDialogTest::shouldHaveDefaultValue()
{
ConfirmAddressEmailEntryDialog dlg;
QVBoxLayout *mainLayout = dlg.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QLabel *label = dlg.findChild<QLabel *>(QStringLiteral("label"));
QVERIFY(label);
QVERIFY(!label->text().isEmpty());
QLineEdit *mLineEdit = dlg.findChild<QLineEdit *>(QStringLiteral("lineedit"));
QVERIFY(mLineEdit);
QVERIFY(mLineEdit->text().isEmpty());
QVERIFY(mLineEdit->validator());
QVERIFY(qobject_cast<const KPIM::EmailValidator *>(mLineEdit->validator()));
QDialogButtonBox *buttons = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttons"));
QVERIFY(buttons);
}
......@@ -27,6 +27,8 @@ class ConfirmAddressEmailEntryDialogTest : public QObject
public:
explicit ConfirmAddressEmailEntryDialogTest(QObject *parent = nullptr);
~ConfirmAddressEmailEntryDialogTest() = default;
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // CONFIRMADDRESSEMAILENTRYDIALOGTEST_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment