test(confirm): behaviour tests of the four sites the guard alone held (#467) #492

Merged
maximus merged 5 commits from issue-467-confirm-behaviour-tests into main 2026-10-24 18:10:54 +00:00

5 commits

Author SHA1 Message Date
le king fu
483f886ac0 test: prove that holding never calls a component either (#467)
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 2m53s
Self-review: the docblock says that neither helper calls a component of the tree, but only find had a test for it. holding gets its own (a holder that a child component renders is not found, the component is never called). The header no longer reads as if no test file kept a copy of its own: several still do.

Resolves #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 09:05:23 -04:00
le king fu
cecaca910b docs(architecture): name elementTree and recount the harness users (#467)
The section on the hook harness now says what find and holding do, who uses them, and that sixteen test files keep their own copy (grep cited). Harness users recounted with the grep of that line: 25 test files on 2026-10-23, the four delete tests of #467 among them.

Resolves #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 09:05:23 -04:00
le king fu
ed49c74cc9 test: give the delete fixtures numbers apart from their id (#467)
A sort order equal to the id let a handler that passed the sort order pass the id assertion. The category fixtures of the CategoryDetailPanel and AccountsPage tests now carry a sort order (and a keyword count) of their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 09:05:23 -04:00
le king fu
fdcca057cd test: pin what four confirmation sites do with the answer (#467)
native-dialog-guard.test.ts checks that each confirmAction( is awaited, not what the handler does once the user answers. Behaviour tests on the hook harness for the four sites it alone held: CategoryDetailPanel (and the deleteBlocked message at the next render), AdjustmentDetailPanel, TemplateActions (stopPropagation before the answer, never commit()) and AccountsPage (a seeded category or one with linked accounts opens no dialog). Each refusal leaves the data alone, each acceptance deletes the right id, and each asserts the marked message passed to confirmAction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 09:05:23 -04:00
le king fu
99323b57e1 test: share find and holding in src/test/elementTree.ts (#467)
find(node, pred) returns every element the predicate keeps, depth first, through arrays and fragments; holding(node, type) returns every element one of whose direct children is of the type (the button that holds a Trash2, not the icon). Both keep the semantics of the copies they replace, each proved by elementTree.test.ts. ProfileFormModal.delete.test.ts and BudgetPage.wiring.test.ts drop their local copy and import the helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 09:05:23 -04:00