Commit d32aeb97 authored by Laurent Montel's avatar Laurent Montel 😁

Add more autotests

parent 7d8f15c5
......@@ -20,6 +20,7 @@
#include <QTest>
#include <QPageLayout>
#include <QSignalSpy>
#include <QWebEngineView>
PrintWebEngineViewJobTest::PrintWebEngineViewJobTest(QObject *parent)
: QObject(parent)
......@@ -49,4 +50,16 @@ void PrintWebEngineViewJobTest::shouldFailedWhenWebEngineIsNotDefined()
QCOMPARE(spySuccess.count(), 0);
}
void PrintWebEngineViewJobTest::shouldFailedWhenPageLayoutIsNotDefined()
{
WebEngineViewer::PrintWebEngineViewJob job;
QSignalSpy spyFailed(&job, SIGNAL(failed()));
QSignalSpy spySuccess(&job, SIGNAL(success(QString)));
job.setEngineView(new QWebEngineView());
job.start();
QCOMPARE(spyFailed.count(), 1);
QCOMPARE(spySuccess.count(), 0);
}
QTEST_MAIN(PrintWebEngineViewJobTest)
......@@ -29,6 +29,7 @@ public:
private Q_SLOTS:
void shouldHaveDefaultValue();
void shouldFailedWhenWebEngineIsNotDefined();
void shouldFailedWhenPageLayoutIsNotDefined();
};
#endif // PRINTWEBENGINEVIEWJOBTEST_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