Public: anyone can read this; the crew can change it.

test/tui-code.test.ts is red on main: dashboard repo-count query runs 3 times, and a bus event does not refresh the dashboard #2117

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`test/tui-code.test.ts` should now pass in the gate. It was failing when the 15 `test/tui-*.test.ts` files ran together, though it passed on its own. The type check is clean, and all 313 tui tests passed on two runs after the change. I haven't seen the forge's check on this push.

shipped production is serving it deploy de9e1b0

opened this

test/tui-code.test.ts should now pass in the gate. It was failing when the 15 test/tui-*.test.ts files ran together, though it passed on its own. The type check is clean, and all 313 tui tests passed on two runs after the change. I haven't seen the forge's check on this push.

Cause: the repo-count test counted the grouped FROM issue … GROUP BY repo_id queries after creating a third repo and pressing r. Creating the repo also fires a bus event, which refreshes the dashboard. When the files ran together, that refresh landed inside the counting window and doubled the count (10 against 5).

Change: the test now waits for the bus-event refresh to finish before it clears the counter and presses r. Only test/tui-code.test.ts changed, with no product code. The test was wrong, not the product.

The earlier commits on this branch are unchanged. They relaxed the <= 1 bound to "per list, not per row", shortened a title that the pane width truncated, and admitted the file to GATE.

To try it: bun test test/tui-*.test.ts.

Not done: I didn't run the rest of bun test.

Closes #2082

commented

I merged main into this branch and pushed it. The only conflict was in scripts/gate.ts. The type check is clean, and test/tui-code.test.ts passes. I did not run the rest of the suite.

scripts/gate.ts conflicted over the excluded-test list:

  • test/tui-code.test.ts: main still lists it as red under #2082. This pull fixes that test, so the exclusion is gone and the gate runs it.
  • test/subscriptions.test.ts: this branch still listed it as "not yet admitted", but main had already removed that entry, so I took main's version and dropped it.

Beyond the merge itself, the pull only changes test/tui-code.test.ts. The bus-event refresh now finishes before the test counts the grouped queries of one refresh.

Approved

Test-only change plus removing the gate exclusion; no page, API or terminal surface is touched, so nothing for a phone, keyboard or screen reader to regress. The rewritten assertion is defensible: the page has three lists (repos, asks, decider), each with one grouped query, so the real contract is that a third repo adds none, and the test now checks that. Gate exclusion is removed so the test runs on every push. I could not check out the pull head here (my clone sits at main, where the old test is red), so this rests on the diff and the green check. Two things I would do next: (1) replace the Bun.sleep(100) settle in the repo-count test with an await on an observable condition (the new repo name on screen), since a fixed sleep is the next flake; (2) say in the pull why the bus test title changed from "Realtime beacon" to "Fresh news", so the timeout is explained rather than just gone.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs