Repository navigation
Test that the board rail counts the list the board draws - #2087
Conversation
`counts` reads `groupTasks` on a room board and `own` on a Bot board, but every case that reached a room seeded `own` with the same cards, so a change to either side of that branch stayed green: counts hard-wired to `own` kept 21/21. Seed the two lists apart — a stale Bot board read beside a room's list, and a room list still in state on a Bot board — and assert the rail's number from the list the board actually draws.
|
@Birfy — review request for this tip, once. Test-only change ( CI is complete here: 14/14 check runs success at this sha ( |
|
Self-test: PASS at d799eb7 Advisory only — not a review, no Ran (all at
Why the old file could not see it: the room fixture seeds Not verified: real browser DOM/screenshot and clipboard; |
Fixes #2086
Written-by: Dev-1
Owner: Dev-1
Reviewer: Birfy
Claim-Id: d666ef54f2b14bc7bff2e774871e5fc9
Branch: dev/1-kanban-scope-counts
Base: fca35af
Tip SHA: d799eb7
What happens today
#2069fixed the rail so a room board counts the room's list and a Bot board counts its own, atcore/src/client/kanban.js:422:Nothing in
core/test/kanban.test.jspins that branch. The existing room fixtureboardWith(...)fillsownwith the same cards it puts intogroupTasks, so both arms of the ternary produce the same numbers and a single-arm change stays green. Measured on live mainfca35af6with only the source changed:→
core/test/kanban.test.js21 tests / 21 pass / 0 fail, exit 0, three runs identical. The#2069fix can be undone with a fully green file.The change
One case and its fixture, in two mirrored files (
core/test/kanban.test.jsandpatches/ds-bot/files/test/kanban.test.js, the generated mirror),+96 / −0. No source file is touched.boardWithLists(scope, own, groupActive, archive = [])seeds the two lists apart, which the existingboardWithcannot do in a room scope.P-364: the rail counts the list the board draws, never the one the other scope left behindhas one arm per direction. A room board whoseownstill holds the Bot board's read (one card for Writer) while the room's list holds Writer's three and Chief's one must read0/3for Writer and0/1for Chief, who appears only in the room's list. A Bot board whose room list still holds four cards whileownholds two must read0/2, not0/4.Red first (on base
fca35af6)Only the new case added, source untouched:
kanban.js:422made constantown→ 22 / 21 / 1, three runs identical, exit 1. The red isnot ok 15 - P-364: the rail counts the list the board draws, never the one the other scope left behind:'0/1' !== '0/3'— "the room board counts the room's three, not the stale single card".kanban.js:422made constantgroupTasks→ 22 / 18 / 4, three runs identical, exit 1. The red is test 15's Bot arm plus the three existing Bot-board cases:#2045: a page that is not full still reads as the whole history, unchanged(11),#2045: the rail hedge follows the Bot's drawn done rows, not its total(13) and#2069: a room board reached from a Bot board counts each active card once in the rail(17).Both directions are therefore bitten, and neither mutation can hide behind the other's arm.
Verified
TZ=UTC ARCH_DOCS_BASE=fca35af6f29a10214f239b78a2087b82845ba4ce npm run verify, on the committed tree → exit 0: core 2558/2558, social 541, tree 127, timeline 135, workflow 336,.github/scripts575, interop 37, live-e2e 24. Lint: core 73 warnings / 0 errors, the other four packages 36 / 9 / 2 / 16 warnings and 0 errors, interop 1 warning / 0 errors, live-e2e 0 / 0.arch-docs: OK (2 changed file(s))— the two files this branch changes and no others.Also green on the same tree:
node scripts/ds-bot-patches.mjs check(10 patches apply cleanly in order;core/ equals ds-bot/ + patches/ds-bot/) andnode core/scripts/build-client.mjs --check.Which tree the checks ran on
Local commit
a22f6542a6c8fc7b695e7d562af59237ae183b04, tree8fc6072d0045f370a1c2d80b9f707591cf8d9145, single parentfca35af6f29a10214f239b78a2087b82845ba4ce.Verify and
arch-docsran on that checkout. The pushed headd799eb757785aa31cadb6eebd41bc672ec70f5a4was rebuilt from the same tree by the push path, so its sha differs while its tree does not;checks.atnames the pushed tip, which is what CI reads.Not in scope
core/src/client/kanban.jsis unchanged. The ternary has been correct since#2069; this PR only adds the case that reds when it is changed, as the issue scoped it.Not run
The smoke test (nothing under
core/index.jsorcore/src/host/changed) and the packaged Desktop install path.Checkpoint
{ "pr": 2087, "claim": "Dev-1", "issue": 2086, "summary": "The rail counts a room board from groupTasks and a Bot board from own (#2069), but no test could tell the two lists apart: the existing room fixture seeds both with the same cards, so a constant own stayed 21 of 21 green. A new case seeds them apart and asserts 0/3 for a Writer with three room cards, not the stale 0/1, and 0/2 on the Bot board, not the leftover 0/4. Each mutation reds it (always own 22/21/1, always groupTasks 22/18/4) and the unmutated file is 22/22, with no source file touched.", "files": [ "core/test/kanban.test.js", "patches/ds-bot/files/test/kanban.test.js" ], "checks": { "ran": "npm run verify (ARCH_DOCS_BASE=fca35af6, core 2558, .github/scripts 575) exit 0; core/test/kanban.test.js 22/22 x3; mutants always own 22/21/1 x3, always groupTasks 22/18/4 x3", "result": "green", "at": "d799eb757785aa31cadb6eebd41bc672ec70f5a4" }, "next": "none — ready for review" }