Skip to content

test(projects-page): wait for mount load and planTask before asserting - #28046

Merged
javenciu merged 1 commit into
mainfrom
test/act-warnings-projects-page
Nov 2, 2026
Merged

javenciu merged 1 commit into
mainfrom
test/act-warnings-projects-page

Conversation

@javenciu

@javenciu javenciu commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: website/src/test/ProjectsPage.test.tsx stops emitting React act() warnings, so its row leaves website/integration/act-warning-baseline.json and the guard in website/integration/setup.ts checks it like any file outside the list.

Before this change, a run of the file emitted 44 act() warnings (late state updates in ProjectsPage): 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

  • Other files on the baseline (each is its own change).
  • Any change to the components under test.
  • Filtering or silencing the warning; the test waits for the update instead.

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/ProjectsPage.test.tsx: import { act, screen, fireEvent, waitFor } from '@testing-library/react'
  • website/src/test/ProjectsPage.test.tsx: await waitFor(() => expect(taskRunnerStatusMock()).toHaveBeenCalled())
  • website/src/test/ProjectsPage.test.tsx: await waitFor(() => expect(taskRunnerStatusMock()).toHaveBeenCalled())
  • website/src/test/ProjectsPage.test.tsx: await waitFor(() => expect(mockApi.planTask).toHaveBeenCalledWith('do the thing', 'text', '', '', '/custom/dir'))
  • website/src/test/ProjectsPage.test.tsx: await waitFor(() => expect(mockApi.planTask).toHaveBeenCalledWith('do it', 'text', '', '', ''))
  • website/src/test/ProjectsPage.test.tsx: await waitFor(() => expect(taskRunnerStatusMock()).toHaveBeenCalled())
  • website/src/test/ProjectsPage.test.tsx: await waitFor(() => expect(taskRunnerStatusMock()).toHaveBeenCalled())
  • website/src/test/ProjectsPage.test.tsx: await waitFor(() => expect(taskRunnerStatusMock()).toHaveBeenCalled())
  • website/integration/act-warning-baseline.json: removed src/test/ProjectsPage.test.tsx.

Backwards compatibility

Compatible: test-only change.
Removes nothing: a baseline row is a tolerance the guard stops needing, not a capability.

Tests

  • Before (the row removed, the file unchanged): KIROCREW_ACT_STRICT=1 npx vitest run src/test/ProjectsPage.test.tsx from website/: 11 of 41 tests fail on act() warnings.
  • After: the same command passes 5 runs out of 5 with 0 act() warnings; 41 tests, the same count as before.
  • integration/setup.refactor.determinism.test.ts passes (the baseline stays sorted, unique and existing); npx eslint is 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.

Make website/src/test/ProjectsPage.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.
@javenciu
javenciu requested review from a team and KiroCrewCaptain as code owners November 2, 2026 10:30
@javenciu
javenciu requested a review from mbriones98 November 2, 2026 10:30
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision 42aa02238a0abdead1f6b9f5cadd309728a9f409 ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Does not block merge.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 42aa02238a0abdead1f6b9f5cadd309728a9f409 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

No design-level concerns: this change only touches a test and its baseline, and nothing in the product renders differently.

Notes

  • Waiting until taskRunnerStatusMock() has been called shows the mount effect fired, not that its promise settled and set state. Waiting on the DOM state that call produces would be a sturdier barrier against the same act() warnings coming back.
  • The "What changed" list leaves out the two await act(async () => { capturedNavigate!(...) }) wrappers that the diff adds.

[DESIGN-REVIEWED] 42aa022

Description read

[DESCRIPTION-READ] 41b1a92d70b08bc31e2dfd528a8cbe6c8397c155c3d044fb1c663296e60691ee

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 42aa02238a0abdead1f6b9f5cadd309728a9f409 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing to check. The PR only changes a test file and the test baseline, so there is no user-visible control to show in a screenshot.

[UX-REVIEWED] 42aa022

Description read

[DESCRIPTION-READ] 4a22e94284254361a8c78646e4106fb592c1bdfb5af6af8d5591af20377fc923

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 42aa02238a0abdead1f6b9f5cadd309728a9f409 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 42aa022

Verdict parsed from the review's SHA-scoped output markers for commit 42aa02238a0abdead1f6b9f5cadd309728a9f409.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 42aa02238a0abdead1f6b9f5cadd309728a9f409 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 42aa02238a0abdead1f6b9f5cadd309728a9f409 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 42aa022

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 42aa02238a0abdead1f6b9f5cadd309728a9f409 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 2, 2026
@javenciu
javenciu enabled auto-merge (squash) November 2, 2026 13:06

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: waits for mount load before asserting in one projects page test and drops it from the act-warning baseline (tightening).

@javenciu
javenciu merged commit bda86f0 into main Nov 2, 2026
149 of 150 checks passed
@javenciu
javenciu deleted the test/act-warnings-projects-page branch November 2, 2026 13:28
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants