From 8d62ea99c71bae11610b3d1c6ec3d471b19db517 Mon Sep 17 00:00:00 2001 From: papi Date: Fri, 14 Aug 2026 19:57:46 -0400 Subject: [PATCH] test(command-center): re-pin the Insert quick-key guard to the callback bucket The source guard asserted on the literal "NovaQuickMenuActionId.QUICK_CTRL_V -> onQuickKey(action.id)", which only held while Ctrl+V happened to be the last id in the fall-through group. Adding Ctrl+1 and Ctrl+2 in #237 moved the arm onto QUICK_CTRL_2, so the assertion went red on master even though Insert still routes exactly as the guard intends. The invariant the guard carries is that Insert sits inside the group whose arm calls onQuickKey, so assert that directly. Slice the bucket between the QUICK_ESC entry and the onQuickKey arm, then look for Insert inside the slice. Both substring calls pass an empty missing-delimiter value, so losing either anchor empties the slice and fails the assertion instead of silently passing on the whole file. Appending a further quick key no longer needs a guard edit. --- .../test/java/com/papi/nova/ui/NovaComposeSourceGuardTest.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/test/java/com/papi/nova/ui/NovaComposeSourceGuardTest.kt b/app/src/test/java/com/papi/nova/ui/NovaComposeSourceGuardTest.kt index 18a6cebb..23565e72 100644 --- a/app/src/test/java/com/papi/nova/ui/NovaComposeSourceGuardTest.kt +++ b/app/src/test/java/com/papi/nova/ui/NovaComposeSourceGuardTest.kt @@ -2196,10 +2196,11 @@ class NovaComposeSourceGuardTest { state.contains("QUICK_INSERT") && state.contains("R.string.game_menu_send_keys_insert") ) + val quickKeyBucket = content.substringAfter("NovaQuickMenuActionId.QUICK_ESC,", "") + .substringBefore("-> onQuickKey(action.id)", "") assertTrue( "Insert quick key should route through the same Command Center quick-key callback bucket as the other special keys", - content.contains("NovaQuickMenuActionId.QUICK_INSERT,") && - content.contains("NovaQuickMenuActionId.QUICK_CTRL_V -> onQuickKey(action.id)") + quickKeyBucket.contains("NovaQuickMenuActionId.QUICK_INSERT,") ) assertTrue( "Insert quick key should route through the existing Windows VK_INSERT translator path",