test(wasm-client): cover the new save prompt, and correct a false comment

Adding `AppMode::SavePrompt` extended nothing in the browser client,
because `keys.rs::text_entry_modes` is a hand-written list and the new
mode was simply absent from it. Adding the line and watching the two
tests that consume it — typing resolves locally, backspace pops locally —
pass unchanged confirms the shared keymap already carries the mode into
the browser with no client-side change, which is the point of the keymap
move.

The comment on that helper claimed a new mode "shows up here as a missing
line rather than as untested behaviour". It does not; nothing checks the
list against `AppMode`, and `save_prompt` was silently uncovered until
added by hand. There is a second hand-written copy in
improvise-command's `text_entry_modes_with_exits`. The comment now says
what is true, and deriving both from one place is reported for filing
rather than done here — it is outside this unit's boundary.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Edward Langley
2026-09-19 22:45:42 -07:00
parent 6a2b46be5b
commit f129305e31
+11 -2
View File
@@ -726,8 +726,16 @@ mod tests {
KeyEvent::new(code, KeyModifiers::NONE)
}
/// Every text-entry mode, built by its own constructor so a new one shows
/// up here as a missing line rather than as untested behaviour.
/// Every text-entry mode, built by its own constructor.
///
/// The comment here used to claim a new mode "shows up as a missing line
/// rather than as untested behaviour". It does not: this is a hand-written
/// list and nothing checks it against `AppMode`, so a new text-entry mode
/// is simply absent and silently uncovered — which is what happened to
/// `save_prompt` (improvise-lae) until it was added by hand. There is a
/// second hand-written copy in `improvise-command`'s
/// `keymap::tests::text_entry_modes_with_exits`. Deriving both from one
/// place is filed, not done here.
fn text_entry_modes() -> Vec<AppMode> {
vec![
AppMode::editing(),
@@ -737,6 +745,7 @@ mod tests {
AppMode::category_add(),
AppMode::item_add("Region".into()),
AppMode::export_prompt(),
AppMode::save_prompt(),
]
}