Repository navigation
Commit 6f1c016
authored
Test that the board rail counts the list the board draws (#2087)
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
`#2069` fixed the rail so a room board counts the room's list and a Bot
board counts its own, at `core/src/client/kanban.js:422`:
```js
for (const task of [...(scope?.kind === 'group' ? groupTasks : own), ...(archive ?? []).slice(0, ARCHIVE_SHOWN)]) {
```
Nothing in `core/test/kanban.test.js` pins that branch. The existing
room fixture `boardWith(...)` fills `own` with the same cards it puts
into `groupTasks`, so both arms of the ternary produce the same numbers
and a single-arm change stays green. Measured on live main `fca35af6`
with only the source changed:
```js
// kanban.js:422, made constant:
for (const task of [...(own), ...(archive ?? []).slice(0, ARCHIVE_SHOWN)]) {
```
→ `core/test/kanban.test.js` **21 tests / 21 pass / 0 fail, exit 0**,
three runs identical. The `#2069` fix can be undone with a fully green
file.
## The change
One case and its fixture, in two mirrored files
(`core/test/kanban.test.js` and
`patches/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 existing `boardWith` cannot do in a room
scope.
- `P-364: the rail counts the list the board draws, never the one the
other scope left behind` has one arm per direction. A room board whose
`own` still holds the Bot board's read (one card for Writer) while the
room's list holds Writer's three and Chief's one must read `0/3` for
Writer and `0/1` for Chief, who appears only in the room's list. A Bot
board whose room list still holds four cards while `own` holds two must
read `0/2`, not `0/4`.
## Red first (on base `fca35af6`)
Only the new case added, source untouched:
- as-is → **22 tests / 22 pass / 0 fail**, exit 0, three runs identical.
- `kanban.js:422` made constant `own` → **22 / 21 / 1**, three runs
identical, exit 1. The red is `not 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:422` made constant `groupTasks` → **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/scripts` **575**, 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/`) and `node core/scripts/build-client.mjs --check`.
## Which tree the checks ran on
Local commit `a22f6542a6c8fc7b695e7d562af59237ae183b04`, tree
`8fc6072d0045f370a1c2d80b9f707591cf8d9145`, single parent
`fca35af6f29a10214f239b78a2087b82845ba4ce`.
Verify and `arch-docs` ran on that checkout. The pushed head
`d799eb757785aa31cadb6eebd41bc672ec70f5a4` was rebuilt from the same
tree by the push path, so its sha differs while its tree does not;
`checks.at` names the pushed tip, which is what CI reads.
## Not in scope
- `core/src/client/kanban.js` is 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.
- No changelog fragment and no subsystem doc: nothing user-visible
changes.
## Not run
The smoke test (nothing under `core/index.js` or `core/src/host/`
changed) and the packaged Desktop install path.
## Checkpoint
<!-- flybot:checkpoint -->
```json
{
"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"
}
```
<!-- /flybot:checkpoint -->1 parent 7166f5a commit 6f1c016
2 files changed
Lines changed: 96 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
438 | 486 | | |
439 | 487 | | |
440 | 488 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
438 | 486 | | |
439 | 487 | | |
440 | 488 | | |
| |||
0 commit comments