From d1ed9c022f717fe6eac360dc1f1b849c867eb7cb Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 4 Jun 2026 17:50:34 +0200 Subject: [PATCH] test(stammbaum): fix #718 tab-order test for tidy-tree layout (#724) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../lib/person/genealogy/StammbaumTree.svelte.test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/person/genealogy/StammbaumTree.svelte.test.ts b/frontend/src/lib/person/genealogy/StammbaumTree.svelte.test.ts index da84f5e8..409459ea 100644 --- a/frontend/src/lib/person/genealogy/StammbaumTree.svelte.test.ts +++ b/frontend/src/lib/person/genealogy/StammbaumTree.svelte.test.ts @@ -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', () => {