summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_mainwindow.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_mainwindow.cpp b/tests/test_mainwindow.cpp
index 5969da9..4c0f32a 100644
--- a/tests/test_mainwindow.cpp
+++ b/tests/test_mainwindow.cpp
@@ -465,6 +465,7 @@ private slots:
void placeholderCountsDropAnUncountableQuery();
void flatModeDoesNotSurviveTheNextQuery();
void noTwoActionsShareAnIcon();
+ void theSpamActionCarriesTheBugIconWithAFallback();
void theMessagePaneCarriesItsOwnActionBar();
void theMainToolbarKeepsOnlyListWideActions();
void theMessageBarSitsAboveTheBodyAndBelowTheHeader();
@@ -8756,6 +8757,25 @@ void TestMainWindow::noTwoActionsShareAnIcon()
.arg(collisions.join(QStringLiteral("; ")))));
}
+void TestMainWindow::theSpamActionCarriesTheBugIconWithAFallback()
+{
+ // Task 5. `bug` is the glyph the user asked for, and it is not a
+ // freedesktop name every theme carries, so the table pairs it with
+ // `mail-mark-junk` as a fallback: a theme without the bug still draws a
+ // junk icon rather than degrading the action to text alone.
+ const Config config;
+ MainWindow window(config);
+
+ auto *spam = window.findChild<QAction *>(QStringLiteral("spam"));
+ QVERIFY2(spam, "no action named spam");
+ QVERIFY2(!spam->icon().isNull(), "the spam action carries no icon");
+
+ const QPair<QString, QString> names =
+ MainWindow::iconNamesForTesting(QStringLiteral("spam"));
+ QCOMPARE(names.first, QStringLiteral("bug"));
+ QCOMPARE(names.second, QStringLiteral("mail-mark-junk"));
+}
+
// Constructing a MainWindow needs a QApplication and a platform plugin. The
// test has no display under ctest, so it runs offscreen unless the caller
// asked for something else.