test(display): pin the browser's declined_at arm and the removal operands to keys (improvise-cq1q.13)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VdfEGXA7aJ6ftMsCc9PJze
This commit is contained in:
Claude (adr007-2c)
2026-10-09 13:30:42 -07:00
committed by Edward Langley
parent 300b5afc7f
commit 369d1e12c0
3 changed files with 38 additions and 1 deletions
+13
View File
@@ -2187,6 +2187,11 @@ axis status passes `cat_name` (fails); the filter status passes the item key
(fails); the item-add mode is built from the display (fails on the
`category: "Type"` assertion).
Review follow-up: the same test now also pins the operands. Rivals: the host
`RemoveCategory` and `SetPageSelection` given the display fail on the
`RemoveCategory("Type")` and `item: "Food"` assertions. The client twin fails the
same way on `RemoveCategory`.
### command::cmd::tile::tests::a_tile_status_names_the_display_not_the_key
Rival: the status formats `name`. It fails on both the present display and the
@@ -2208,3 +2213,11 @@ above stay green and this one fails.
The wire's own refusal in `Grids::unwritable`. Rival: the category key; fails. The
formula arm (once a third copy of the derived wording, now `derived_refusal`) is
pinned to its wording so the consolidation cannot change what it says.
### resolve::display_tests::the_declines_an_advance_and_a_commit_reach_name_the_category_it_shows
From the Opus review of #339: the browser's `declined_at` non-item arm could pass the
key with the whole suite green. It is reached by `reopened_at` (an advance),
`refused_here` (a commit) and `settle_declined_editor`. Rival: the arm passes
`category`; the test fails on all three assertions, and the display is 36 characters
against the key "Region".
@@ -208,6 +208,8 @@ mod tests {
assert_eq!(ctx.cat_at_cursor().as_deref(), Some("Type"), "setup");
assert!(said(&CycleAxisAtCursor.execute(&ctx)).contains(&format!("{TYPE} → ")));
assert!(said(&DeleteCategoryAtCursor.execute(&ctx)).contains(&format!("'{TYPE}'")));
let removal = format!("{:?}", DeleteCategoryAtCursor.execute(&ctx));
assert!(removal.contains("RemoveCategory(\"Type\")"), "{removal}");
let prompt = format!("{:?}", OpenItemAddAtCursor.execute(&ctx));
assert!(
prompt.contains(&format!("add item to {TYPE}: ")),
@@ -219,6 +221,8 @@ mod tests {
);
ctx.cat_panel_cursor = 4;
let filtering = format!("{:?}", FilterToItem.execute(&ctx));
assert!(filtering.contains("item: \"Food\""), "keys: {filtering}");
let filter = said(&FilterToItem.execute(&ctx));
assert!(
filter.contains(&format!("Filter: {TYPE} = {FOOD}")),
+21 -1
View File
@@ -5106,7 +5106,14 @@ mod display_tests {
state.view.cat_panel_cursor = 0;
let cycled = last_status(local(&state, KeyCode::Char(' ')));
assert_eq!(cycled, format!("{REGION} → Col"));
let deleted = last_status(delete_at_cat_cursor(&state).unwrap());
let removal = delete_at_cat_cursor(&state).unwrap();
assert!(
removal.iter().any(|c| matches!(c, Command::Model {
cmd: ModelCommand::RemoveCategory(name), ..
} if name == "Region")),
"the removal names the key: {removal:?}"
);
let deleted = last_status(removal);
assert_eq!(deleted, format!("Deleted category '{REGION}'"));
state.view.cat_panel_cursor = 1;
@@ -5159,6 +5166,19 @@ mod display_tests {
assert_eq!(minibuf.prompt, format!("add item to {REGION}: "));
}
#[test]
fn the_declines_an_advance_and_a_commit_reach_name_the_category_it_shows() {
let stray = displayed(Some(CellId::NonItem {
category: "Region".into(),
item: "Mars".into(),
}));
let want = crate::non_item_refusal(REGION, "Mars");
assert_eq!(declined_at(&stray, 0, 0), Some(want.clone()));
assert_eq!(refused_here(&stray, "commit-cell-edit"), Some(want.clone()));
let advanced = reopened_at(&stray, 0, 0, AppMode::Normal, false);
assert_eq!(advanced, vec![Command::SetStatus(want)]);
}
#[test]
fn a_refused_cell_names_the_category_it_shows() {
let stray = displayed(Some(CellId::NonItem {