summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-07-31 07:50:44 +0200
committerMontel Laurent <[email protected]>2017-07-31 07:50:44 +0200
commit16a082f140ce62be7283d937a88e32fb011d90c6 (patch)
tree06518c0d68a1717a8a062c0f732c2a3771337ec7
parent89272a0b23765f8e107850572aeb98c27d06b52f (diff)
Add autotest
-rw-r--r--src/ksieveui/widgets/autotests/includefilelineedittest.cpp9
-rw-r--r--src/ksieveui/widgets/autotests/includefilelineedittest.h2
-rw-r--r--src/ksieveui/widgets/includefilelineedit.cpp2
3 files changed, 13 insertions, 0 deletions
diff --git a/src/ksieveui/widgets/autotests/includefilelineedittest.cpp b/src/ksieveui/widgets/autotests/includefilelineedittest.cpp
index 6faed1b..f28e83e 100644
--- a/src/ksieveui/widgets/autotests/includefilelineedittest.cpp
+++ b/src/ksieveui/widgets/autotests/includefilelineedittest.cpp
@@ -18,6 +18,8 @@
*/
#include "includefilelineedittest.h"
+#include "../includefilelineedit.h"
+#include <QCompleter>
#include <QTest>
IncludeFileLineEditTest::IncludeFileLineEditTest(QObject *parent)
@@ -26,4 +28,11 @@ IncludeFileLineEditTest::IncludeFileLineEditTest(QObject *parent)
}
+void IncludeFileLineEditTest::shouldHaveDefaultValue()
+{
+ KSieveUi::IncludeFileLineEdit w;
+ QCompleter *completer = w.findChild<QCompleter *>(QStringLiteral("completer"));
+ QVERIFY(completer);
+}
+
QTEST_MAIN(IncludeFileLineEditTest)
diff --git a/src/ksieveui/widgets/autotests/includefilelineedittest.h b/src/ksieveui/widgets/autotests/includefilelineedittest.h
index a5ffad0..244dbf1 100644
--- a/src/ksieveui/widgets/autotests/includefilelineedittest.h
+++ b/src/ksieveui/widgets/autotests/includefilelineedittest.h
@@ -28,6 +28,8 @@ class IncludeFileLineEditTest : public QObject
public:
explicit IncludeFileLineEditTest(QObject *parent = nullptr);
~IncludeFileLineEditTest() = default;
+private Q_SLOTS:
+ void shouldHaveDefaultValue();
};
#endif // INCLUDEFILELINEEDITTEST_H
diff --git a/src/ksieveui/widgets/includefilelineedit.cpp b/src/ksieveui/widgets/includefilelineedit.cpp
index fce93cb..c778382 100644
--- a/src/ksieveui/widgets/includefilelineedit.cpp
+++ b/src/ksieveui/widgets/includefilelineedit.cpp
@@ -27,6 +27,8 @@ IncludeFileLineEdit::IncludeFileLineEdit(QWidget *parent)
: QLineEdit(parent)
{
mCompleter = new QCompleter(this);
+ mCompleter->setObjectName(QStringLiteral("completer"));
+
}
IncludeFileLineEdit::~IncludeFileLineEdit()