Repository navigation
test(use-bottom-terminal): wrap store reset in act in capacity test - #27044
Conversation
Make website/src/test/useBottomTerminal.capacity.test.ts stop emitting React act() warnings, and drop its row from website/integration/act-warning-baseline.json so the guard in website/integration/setup.ts checks it.
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. The diff changes only one test file and a test baseline. Nothing users see is added or changed, so no screenshots are needed. [UX-REVIEWED] 049371e Description read[DESCRIPTION-READ] 207cf66c5c97b6a086dded770d31e4ddc594c58a736bb0ebca0293117efbac95 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. This is a test-only change that removes a baseline row. Wrapping the teardown reset in Notes
[DESIGN-REVIEWED] 049371e Description read[DESCRIPTION-READ] 83b59bcc28cfc6b4087ff9abce3293b70115fc9283c90851516a3ecbbe746e15 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
bolichen97
left a comment
There was a problem hiding this comment.
Approving head 049371e.
useBottomTerminal.capacity.test.ts now wraps the afterEach store reset in act(), so the state update the reset triggers lands inside a React barrier instead of after the test. With that, the file's row leaves website/integration/act-warning-baseline.json and the act() guard checks it from now on. The hook under test is unchanged.
Checked: the test passes locally at this head. 0 checks are red, and the Design, UX, Opus and GPT lanes pass. Only test shards and PR Readiness are still running, and auto-merge waits for them.
Problem / Motivation
Goal:
website/src/test/useBottomTerminal.capacity.test.tsstops emitting React act() warnings, so its row leaveswebsite/integration/act-warning-baseline.jsonand the guard inwebsite/integration/setup.tschecks it like any file outside the list.Before this change, a run of the file emitted 1 act() warning (late state updates in
TestComponent): a state update landed after the test's last barrier. Because the file is on the baseline, the guard kept those warnings out of the log.Why it matters
website/docs/testing.md(Rules every test keeps) treats an act() warning as a finding: the update lands after the assertions, so whether the test sees it depends on timing. The baseline is shrink-only, and each file that leaves it is held to the rule from then on.Not a goal
What changed (motivation → approach → change)
The tests now wait for the state the late update produces before they finish, so the update lands inside the test's barrier.
website/src/test/useBottomTerminal.capacity.test.ts: barrier added (see the diff).website/integration/act-warning-baseline.json: removedsrc/test/useBottomTerminal.capacity.test.ts.Backwards compatibility
Compatible: test-only change.
Removes nothing: a baseline row is a tolerance the guard stops needing, not a capability.
Tests
KIROCREW_ACT_STRICT=1 npx vitest run src/test/useBottomTerminal.capacity.test.tsfromwebsite/: 1 of 1 tests fail on act() warnings.integration/setup.refactor.determinism.test.tspasses (the baseline stays sorted, unique and existing);npx eslintis clean on the file.Manual verification
N/A: test-only change; the strict runs above are the check.
Screenshots / video
Why no screenshot: nothing renders; this change touches one test file and a test baseline only.
No issue exists; burn-down of the act() warning baseline that #17673 introduced.