aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-20 17:31:50 +0200
committerDanilo M. <danix@danix.xyz>2026-08-20 17:31:50 +0200
commit81c0086a06d4b13478475c2fa05f040c0511bfba (patch)
tree31b754b931b6553594d8d857870064592c5b6443 /tests
parentc06809634534ed3b6eb81a1648119428567e71a4 (diff)
downloadqtmaildir-81c0086a06d4b13478475c2fa05f040c0511bfba.tar.gz
qtmaildir-81c0086a06d4b13478475c2fa05f040c0511bfba.zip
test(keys): a shortcut is a chosen subset, not a requirement, item 132
everyActionHasAShortcut() was written when the action list was short and every action plausibly deserved a chord. Item 123 adds six more, and under that rule each one consumes a key sequence whether or not anyone would ever press it. Rarely-used actions were being given chords to satisfy a test rather than because a user wanted them. everyActionIsReachableFromAMenu() is the rule that actually matters, and it already has the right shape: it is what stops an action shipping invisible, which is the defect item 103 found when `restore` was reachable by a chord and by nothing a user could see. Discoverability comes from the menu. A shortcut is an accelerator for the things done often. Nothing replaces the deleted test and nothing else needed changing: showShortcutReference() already prints `(unbound)` for an empty sequence, so the code anticipated this and only the test forbade it. Verified rather than assumed: with `tag_rules` unbound in defaultBindings(), an action that is registered, menu-reachable and carries an icon but has no chord at all, the full suite passes. Before this commit it failed. CLAUDE.md's "adding an action is FIVE places" paragraph is updated, including its count of how many are test-enforced, which drops from four to three.
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/test_mainwindow.cpp17
2 files changed, 1 insertions, 17 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index f9bc7d1..d1d8a29 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -65,6 +65,7 @@ add_qtmaildir_test(tagdialog)
add_qtmaildir_test(tagrules)
add_qtmaildir_test(rulequery)
add_qtmaildir_test(searchterm)
+add_qtmaildir_test(busyindicator)
add_qtmaildir_test(tagstrip)
add_qtmaildir_test(messagedetailsdialog)
add_qtmaildir_test(translations)
diff --git a/tests/test_mainwindow.cpp b/tests/test_mainwindow.cpp
index 0deaec3..4d70a29 100644
--- a/tests/test_mainwindow.cpp
+++ b/tests/test_mainwindow.cpp
@@ -178,7 +178,6 @@ private slots:
void noTestCanSeeTheRealLockTable();
void everyKnownActionIsRegistered();
void everyRegisteredActionIsKnown();
- void everyActionHasAShortcut();
void configuredBindingReachesTheAction();
void cidPrefixesAreBangFree();
void cidPrefixesAreDistinctPerMessage();
@@ -489,22 +488,6 @@ void TestMainWindow::everyRegisteredActionIsKnown()
}
}
-void TestMainWindow::everyActionHasAShortcut()
-{
- // An action with no binding is unreachable from the keyboard. Every one
- // of them carries a default, so an empty shortcut means the default table
- // and the action list have drifted apart.
- const Config config;
- MainWindow window(config);
-
- for (const QString &name : window.registeredActionNames()) {
- const QAction *action = window.findChild<QAction *>(name);
- QVERIFY2(action, qPrintable(QStringLiteral("no QAction named '%1'").arg(name)));
- QVERIFY2(!action->shortcut().isEmpty(),
- qPrintable(QStringLiteral("action '%1' has no shortcut").arg(name)));
- }
-}
-
void TestMainWindow::configuredBindingReachesTheAction()
{
// The whole point of [keys]: a user's override must end up on the QAction,