Repository navigation
test(chat-page): run the embedded no-navigation windows on fake timers - #27759
Conversation
Make website/src/test/ChatPage.embedded.test.tsx 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 PR changes only a test file and the test baseline. No user-visible control is added or changed, so no screenshots are needed. [UX-REVIEWED] 943c46b Description read[DESCRIPTION-READ] 12c66a8af7f8c4a9c7904b8a277011840382d5a0b05090a67f67eb07e4742ff2 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: it only touches tests, the baseline row it removes only tolerated warnings, and each negative check still waits out its own window. [DESIGN-REVIEWED] 943c46b Description read[DESCRIPTION-READ] 99af7b4ff14852c35849b9a9a1aca28e216c8943089097a8b0a3a5990f277391 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: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: test-only: runs the embedded no-navigation windows on fake timers inside act, and drops the file from the act-warning baseline.
Problem / Motivation
Goal:
website/src/test/ChatPage.embedded.test.tsxstops 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 17 act() warnings (late state updates in
ChatPage): 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.
Where a real-timer wait guarded a "nothing happens within N ms" check, the window now runs on fake timers installed after the render has settled and is advanced past inside act(), as
website/docs/testing.mdasks (fake timers go on after the render settles;integration/setup.tsrestores them). Each negative assertion keeps the window it needs, so it still fails if the request it guards against fires.website/src/test/ChatPage.embedded.test.tsx:import { render, waitFor, act } from '@testing-library/react'website/src/test/ChatPage.embedded.test.tsx:await act(async () => { await vi.advanceTimersByTimeAsync(100) })website/src/test/ChatPage.embedded.test.tsx:await act(async () => { await vi.advanceTimersByTimeAsync(100) })website/src/test/ChatPage.embedded.test.tsx:await act(async () => { await vi.advanceTimersByTimeAsync(100) })website/integration/act-warning-baseline.json: removedsrc/test/ChatPage.embedded.test.tsx.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/ChatPage.embedded.test.tsxfromwebsite/: 3 of 4 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.