test(stammbaum): fix #718 tab-order test for tidy-tree layout (#724)
All checks were successful
CI / Unit & Component Tests (pull_request) Successful in 3m15s
CI / OCR Service Tests (pull_request) Successful in 22s
CI / Backend Unit Tests (pull_request) Successful in 3m38s
CI / fail2ban Regex (pull_request) Successful in 43s
CI / Semgrep Security Scan (pull_request) Successful in 21s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m4s

The #718 keyboard-tab-order test hardcoded the visual order
['Eugenie','Walter','Clara','Hans'] on the assumption that buildLayout
sorts each generation alphabetically. #724 replaced that with the
tidy-tree layout, which orders a couple's run by structural ownership
(earliest birth year, then a deterministic id tie-break) — so Walter
(id …a1) now owns the run and Eugenie renders to his right.

Both PRs were green independently; the stale assertion only surfaced
once #718 and #724 landed together on main. Correct the expected reading
order to ['Walter','Eugenie','Clara','Hans'] and refresh the now-wrong
'alphabetical' comment. The companion self-validating test (DOM order ==
sorted by y,x) already guarded the real property, so only the hardcoded
assertion needed updating.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-06-04 17:50:34 +02:00
parent 0693cfddd1
commit ac326f25fa

View File

@@ -1099,9 +1099,11 @@ describe('StammbaumTree keyboard tab order (#718)', () => {
const CLARA = '00000000-0000-0000-0000-0000000000a3';
const HANS = '00000000-0000-0000-0000-0000000000a4';
// Walter ↔ Eugenie (gen 0); their children Clara + Hans (gen 1). buildLayout
// sorts each generation alphabetically, so the deterministic visual order is
// Eugenie, Walter (top row) then Clara, Hans (next row).
// Walter ↔ Eugenie (gen 0); their children Clara + Hans (gen 1). The tidy-tree
// layout (#724) orders a couple's run by structural ownership (earliest birth
// year, then a deterministic id tie-break), not alphabetically — with no birth
// years here Walter (id …a1) owns the run and Eugenie sits to his right. So the
// deterministic visual order is Walter, Eugenie (top row) then Clara, Hans.
const FAMILY_EDGES = [
{
id: 'sp',
@@ -1171,7 +1173,7 @@ describe('StammbaumTree keyboard tab order (#718)', () => {
});
// Top generation left-to-right, then next generation left-to-right.
expect(nodeLabelsInDomOrder()).toEqual(['Eugenie', 'Walter', 'Clara', 'Hans']);
expect(nodeLabelsInDomOrder()).toEqual(['Walter', 'Eugenie', 'Clara', 'Hans']);
});
it('orders tab stops by rendered position regardless of input order', () => {