Commit f122c054 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add more autotests

parent d4c02ffe
......@@ -106,4 +106,15 @@ void MailWebEngineAccessKeyAnchorFromHtmlTest::shouldReturnOneAnchor()
QCOMPARE(resultLst.count(), 1);
}
void MailWebEngineAccessKeyAnchorFromHtmlTest::shouldReturnTwoAnchor()
{
TestWebEngineAccessKey w;
QSignalSpy accessKeySpy(&w, SIGNAL(accessKeySearchFinished(QVector<MessageViewer::MailWebEngineAccessKeyAnchor>)));
w.setHtml(QStringLiteral("<body>foo<a href=\"http://www.kde.org\">foo</a><a href=\"http://www.kde.vv\">foo</a></body>"));
QVERIFY(accessKeySpy.wait());
QCOMPARE(accessKeySpy.count(), 1);
const QVector<MessageViewer::MailWebEngineAccessKeyAnchor> resultLst = accessKeySpy.at(0).at(0).value<QVector<MessageViewer::MailWebEngineAccessKeyAnchor> >();
QCOMPARE(resultLst.count(), 2);
}
QTEST_MAIN(MailWebEngineAccessKeyAnchorFromHtmlTest)
......@@ -50,6 +50,7 @@ public:
private Q_SLOTS:
void shouldNotShowAccessKeyWhenHtmlAsNotAnchor();
void shouldReturnOneAnchor();
void shouldReturnTwoAnchor();
};
#endif // MAILWEBENGINEACCESSKEYANCHORFROMHTMLTEST_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