Commit 90aaa0c9 authored by Laurent Montel's avatar Laurent Montel 😁

Add autotest for vacation dialog

parent 5e4aaaa8
...@@ -17,7 +17,11 @@ ...@@ -17,7 +17,11 @@
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
*/ */
#include "vacationdialogtest.h" #include "vacationdialogtest.h"
#include "../vacationdialog.h"
#include <KSeparator>
#include <QDialogButtonBox>
#include <QTest> #include <QTest>
#include <vacation/vacationeditwidget.h>
VacationDialogTest::VacationDialogTest(QObject *parent) VacationDialogTest::VacationDialogTest(QObject *parent)
: QObject(parent) : QObject(parent)
...@@ -30,4 +34,21 @@ VacationDialogTest::~VacationDialogTest() ...@@ -30,4 +34,21 @@ VacationDialogTest::~VacationDialogTest()
} }
void VacationDialogTest::shouldHaveDefaultValue()
{
const QString title = QStringLiteral("title");
KSieveUi::VacationDialog w(title);
QCOMPARE(w.windowTitle(), title);
QDialogButtonBox *buttonBox = w.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
QVERIFY(buttonBox);
KSieveUi::VacationEditWidget *mVacationEditWidget = w.findChild<KSieveUi::VacationEditWidget *>(QStringLiteral("vacationeditwidget"));
QVERIFY(mVacationEditWidget);
KSeparator *separator = w.findChild<KSeparator *>(QStringLiteral("separator"));
QVERIFY(separator);
}
QTEST_MAIN(VacationDialogTest) QTEST_MAIN(VacationDialogTest)
...@@ -27,6 +27,8 @@ class VacationDialogTest : public QObject ...@@ -27,6 +27,8 @@ class VacationDialogTest : public QObject
public: public:
explicit VacationDialogTest(QObject *parent = Q_NULLPTR); explicit VacationDialogTest(QObject *parent = Q_NULLPTR);
~VacationDialogTest(); ~VacationDialogTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
}; };
#endif // VACATIONDIALOGTEST_H #endif // VACATIONDIALOGTEST_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