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 4bc879fd authored by Laurent Montel's avatar Laurent Montel 😁

Improve autotest

parent f04135e5
......@@ -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));
}
......@@ -28,6 +28,8 @@ class MarkdownPluginTest : public QObject
public:
explicit MarkdownPluginTest(QObject *parent = nullptr);
~MarkdownPluginTest() = default;
private Q_SLOTS:
void shouldCreateInterface();
};
#endif // MARKDOWNPLUGINTEST_H
......@@ -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);
}
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