Commit 20b298cf authored by Simone Gaiarin's avatar Simone Gaiarin Committed by Albert Astals Cid
Browse files

Test enabled state of "Quick Annotations" action

parent 558742a0
...@@ -244,6 +244,7 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState() ...@@ -244,6 +244,7 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState()
QVERIFY(part); QVERIFY(part);
KActionCollection *ac = part->actionCollection(); KActionCollection *ac = part->actionCollection();
QAction *aQuickTools = ac->action(QStringLiteral("annotation_favorites"));
QAction *aHighlighter = ac->action(QStringLiteral("annotation_highlighter")); QAction *aHighlighter = ac->action(QStringLiteral("annotation_highlighter"));
QAction *aUnderline = ac->action(QStringLiteral("annotation_underline")); QAction *aUnderline = ac->action(QStringLiteral("annotation_underline"));
QAction *aSquiggle = ac->action(QStringLiteral("annotation_squiggle")); QAction *aSquiggle = ac->action(QStringLiteral("annotation_squiggle"));
...@@ -255,6 +256,7 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState() ...@@ -255,6 +256,7 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState()
QAction *aGeomShapes = ac->action(QStringLiteral("annotation_geometrical_shape")); QAction *aGeomShapes = ac->action(QStringLiteral("annotation_geometrical_shape"));
QAction *aStamp = ac->action(QStringLiteral("annotation_stamp")); QAction *aStamp = ac->action(QStringLiteral("annotation_stamp"));
QFETCH(bool, aQuickToolsEnabled);
QFETCH(bool, aHighlighterEnabled); QFETCH(bool, aHighlighterEnabled);
QFETCH(bool, aUnderlineEnabled); QFETCH(bool, aUnderlineEnabled);
QFETCH(bool, aSquiggleEnabled); QFETCH(bool, aSquiggleEnabled);
...@@ -266,6 +268,7 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState() ...@@ -266,6 +268,7 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState()
QFETCH(bool, aGeomShapesEnabled); QFETCH(bool, aGeomShapesEnabled);
QFETCH(bool, aStampEnabled); QFETCH(bool, aStampEnabled);
QCOMPARE(aQuickTools->isEnabled(), aQuickToolsEnabled);
QCOMPARE(aHighlighter->isEnabled(), aHighlighterEnabled); QCOMPARE(aHighlighter->isEnabled(), aHighlighterEnabled);
QCOMPARE(aUnderline->isEnabled(), aUnderlineEnabled); QCOMPARE(aUnderline->isEnabled(), aUnderlineEnabled);
QCOMPARE(aSquiggle->isEnabled(), aSquiggleEnabled); QCOMPARE(aSquiggle->isEnabled(), aSquiggleEnabled);
...@@ -281,6 +284,7 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState() ...@@ -281,6 +284,7 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState()
void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState_data() void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState_data()
{ {
QTest::addColumn<QString>("document"); QTest::addColumn<QString>("document");
QTest::addColumn<bool>("aQuickToolsEnabled");
QTest::addColumn<bool>("aHighlighterEnabled"); QTest::addColumn<bool>("aHighlighterEnabled");
QTest::addColumn<bool>("aUnderlineEnabled"); QTest::addColumn<bool>("aUnderlineEnabled");
QTest::addColumn<bool>("aSquiggleEnabled"); QTest::addColumn<bool>("aSquiggleEnabled");
...@@ -292,9 +296,9 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState_data() ...@@ -292,9 +296,9 @@ void AnnotationToolBarTest::testAnnotationToolBarActionsEnabledState_data()
QTest::addColumn<bool>("aGeomShapesEnabled"); QTest::addColumn<bool>("aGeomShapesEnabled");
QTest::addColumn<bool>("aStampEnabled"); QTest::addColumn<bool>("aStampEnabled");
QTest::addRow("pdf") << QStringLiteral(KDESRCDIR "data/file1.pdf") << true << true << true << true << true << true << true << true << true << true; QTest::addRow("pdf") << QStringLiteral(KDESRCDIR "data/file1.pdf") << true << true << true << true << true << true << true << true << true << true << true;
QTest::addRow("protected-pdf") << QStringLiteral(KDESRCDIR "data/protected.pdf") << false << false << false << false << false << false << false << false << false << false; QTest::addRow("protected-pdf") << QStringLiteral(KDESRCDIR "data/protected.pdf") << false << false << false << false << false << false << false << false << false << false << false;
QTest::addRow("image") << QStringLiteral(KDESRCDIR "data/potato.jpg") << false << false << false << false << true << true << true << true << true << true; QTest::addRow("image") << QStringLiteral(KDESRCDIR "data/potato.jpg") << true << false << false << false << false << true << true << true << true << true << true;
} }
void AnnotationToolBarTest::testAnnotationToolBarConfigActionsEnabledState() void AnnotationToolBarTest::testAnnotationToolBarConfigActionsEnabledState()
......
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