From 91920f431cccbd425b28b9ee553fa425c005d7fe Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 14 Sep 2026 12:08:16 +0200 Subject: feat: spam on the message bar, with a bug icon and junk fallback --- tests/test_mainwindow.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests') 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(QStringLiteral("spam")); + QVERIFY2(spam, "no action named spam"); + QVERIFY2(!spam->icon().isNull(), "the spam action carries no icon"); + + const QPair 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. -- cgit v1.2.3