Commit 8ca24325 authored by Laurent Montel's avatar Laurent Montel 😁

Implement autotest

parent 1d5d2415
......@@ -19,8 +19,13 @@
#include "insertshorturlconfigurewidgettest.h"
#include "../insertshorturlconfigurewidget.h"
#include <QComboBox>
#include <QLabel>
#include <QTest>
#include <QVBoxLayout>
QTEST_MAIN(InsertShorturlConfigureWidgetTest)
......@@ -29,3 +34,20 @@ InsertShorturlConfigureWidgetTest::InsertShorturlConfigureWidgetTest(QObject *pa
{
}
void InsertShorturlConfigureWidgetTest::shouldHaveDefaultValues()
{
InsertShorturlConfigureWidget w;
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
QLabel *lab = w.findChild<QLabel *>(QStringLiteral("label"));
QVERIFY(lab);
QVERIFY(!lab->text().isEmpty());
QComboBox *mShortUrlServer = w.findChild<QComboBox *>(QStringLiteral("shorturlserver"));
QVERIFY(mShortUrlServer);
}
......@@ -29,6 +29,8 @@ class InsertShorturlConfigureWidgetTest : public QObject
public:
explicit InsertShorturlConfigureWidgetTest(QObject *parent = nullptr);
~InsertShorturlConfigureWidgetTest() = default;
private Q_SLOTS:
void shouldHaveDefaultValues();
};
#endif // INSERTSHORTURLCONFIGUREWIDGETTEST_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