summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-03-05 07:17:42 +0100
committerLaurent Montel <[email protected]>2018-03-05 07:17:42 +0100
commit4bc879fd7519a485a702f6a50e3559182437b7d9 (patch)
treecd378c2a2cf79213316e015da945fcb5dfc89a51
parentf04135e59e251e4f8eb977fa5b51d27da4eb41d7 (diff)
Improve autotest
-rw-r--r--kmail/editorconvertertextplugins/markdown/autotests/markdownplugintest.cpp10
-rw-r--r--kmail/editorconvertertextplugins/markdown/autotests/markdownplugintest.h2
-rw-r--r--kmail/editorconvertertextplugins/markdown/autotests/markdownpreviewwidgettest.cpp11
3 files changed, 22 insertions, 1 deletions
diff --git a/kmail/editorconvertertextplugins/markdown/autotests/markdownplugintest.cpp b/kmail/editorconvertertextplugins/markdown/autotests/markdownplugintest.cpp
index be684de..20eb04f 100644
--- a/kmail/editorconvertertextplugins/markdown/autotests/markdownplugintest.cpp
+++ b/kmail/editorconvertertextplugins/markdown/autotests/markdownplugintest.cpp
@@ -18,6 +18,9 @@
*/
#include "markdownplugintest.h"
+#include "markdownplugin.h"
+#include "markdowninterface.h"
+#include <KActionCollection>
#include <QTest>
QTEST_MAIN(MarkdownPluginTest)
@@ -26,3 +29,10 @@ MarkdownPluginTest::MarkdownPluginTest(QObject *parent)
{
}
+
+void MarkdownPluginTest::shouldCreateInterface()
+{
+ MarkdownPlugin w;
+ KActionCollection *ac = new KActionCollection(this);
+ QVERIFY(w.createInterface(ac, this));
+}
diff --git a/kmail/editorconvertertextplugins/markdown/autotests/markdownplugintest.h b/kmail/editorconvertertextplugins/markdown/autotests/markdownplugintest.h
index 1c19c5a..aa428a7 100644
--- a/kmail/editorconvertertextplugins/markdown/autotests/markdownplugintest.h
+++ b/kmail/editorconvertertextplugins/markdown/autotests/markdownplugintest.h
@@ -28,6 +28,8 @@ class MarkdownPluginTest : public QObject
public:
explicit MarkdownPluginTest(QObject *parent = nullptr);
~MarkdownPluginTest() = default;
+private Q_SLOTS:
+ void shouldCreateInterface();
};
#endif // MARKDOWNPLUGINTEST_H
diff --git a/kmail/editorconvertertextplugins/markdown/autotests/markdownpreviewwidgettest.cpp b/kmail/editorconvertertextplugins/markdown/autotests/markdownpreviewwidgettest.cpp
index 19babd3..0fc4c46 100644
--- a/kmail/editorconvertertextplugins/markdown/autotests/markdownpreviewwidgettest.cpp
+++ b/kmail/editorconvertertextplugins/markdown/autotests/markdownpreviewwidgettest.cpp
@@ -19,7 +19,9 @@
#include "markdownpreviewwidgettest.h"
#include "markdownpreviewwidget.h"
+#include <QHBoxLayout>
#include <QTest>
+#include <QWebEngineView>
QTEST_MAIN(MarkdownPreviewWidgetTest)
MarkdownPreviewWidgetTest::MarkdownPreviewWidgetTest(QObject *parent)
@@ -30,5 +32,12 @@ MarkdownPreviewWidgetTest::MarkdownPreviewWidgetTest(QObject *parent)
void MarkdownPreviewWidgetTest::shouldHaveDefaultValue()
{
-
+ MarkdownPreviewWidget w;
+ QHBoxLayout *mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainLayout"));
+ QVERIFY(mainLayout);
+ QCOMPARE(mainLayout->margin(), 0);
+
+ QWebEngineView *mWebView = w.findChild<QWebEngineView *>(QStringLiteral("webengine"));
+ QVERIFY(mWebView);
+ QCOMPARE(mWebView->contextMenuPolicy(), Qt::NoContextMenu);
}