Skip to content

test(web): migrate browser tests to the disposable render helper (5/8) - #22270

Merged
juliusmarminge merged 2 commits into
test/web-test-auditfrom
test/web-migrate-5
Oct 20, 2026
Merged

juliusmarminge merged 2 commits into
test/web-test-auditfrom
test/web-migrate-5

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Migrate chunk 5 of the remaining web browser tests to the disposable render helper approved in #22187. Tests now own their roots, timers, global stubs, and spies through disposables; shared mock state resets with explicit setup calls. Existing cases and assertions are preserved, including early unmount and remount coverage.

The baseline lint list contains 132 files, sorted into chunks of ceil(132 / 8) = 17. This PR changes only chunk 5 (positions 69–85), based exactly on ab423b2.

Files (under apps/web/):

  • src/components/diffs/StyledDiffCodeView.browser.test.tsx
  • src/components/files/AttachmentFilePreview.browser.test.tsx
  • src/components/files/BrowserDocumentFrame.browser.test.tsx
  • src/components/files/FileBrowserPanel.browser.test.tsx
  • src/components/files/useFileSaveCoordinator.browser.test.tsx
  • src/components/media/AttachmentImage.browser.test.tsx
  • src/components/onboarding/WelcomeWizard.browser.test.tsx
  • src/components/onboarding/WelcomeWizard.terminal.browser.test.tsx
  • src/components/permissions/usePermissionStatus.browser.test.tsx
  • src/components/preview/PreviewEmptyState.browser.test.tsx
  • src/components/preview/PreviewFaviconIcon.browser.test.tsx
  • src/components/preview/PreviewPanelShell.a11y.browser.test.tsx
  • src/components/projectScriptEditor.browser.test.tsx
  • src/components/projectScriptEditor.permissions.browser.test.tsx
  • src/components/pullRequest/PullRequestCandidatePicker.browser.test.tsx
  • src/components/pullRequest/PullRequestMarkdownEditor.browser.test.tsx
  • src/components/pullRequest/usePullRequestFilesViewed.browser.test.tsx

Unmigrated files: none.

router: false uses:

  • StyledDiffCodeView: worker lifecycle tests use a fake clock and do not navigate.
  • useFileSaveCoordinator, usePermissionStatus, and usePullRequestFilesViewed: isolated hook probes use fake timers and do not navigate.

The favicon fixture is a complete 1×1 GIF, so source failures are driven by the test and use the default router. Queries remain scoped to each screen container. The partial-batch refresh rerender is awaited by the test, and worker cleanup flushes pending timers before restoring spies.

The HEIC success assertion now waits for asynchronous Blob decoding to publish the converted image source. No product behavior changes, so screenshots are not applicable. This is confined to web test infrastructure; other clients, providers, wire contracts, and connection modes are unchanged.

Validation:

  • Browser project, this slice only, three consecutive runs with --reporter=verbose:
    • run 1: 17 files / 106 tests passed (45.07s), 0 act / 0 act-environment / 0 router warnings.
    • run 2: 17 files / 106 tests passed (41.40s), 0 act / 0 act-environment / 0 router warnings.
    • run 3: 17 files / 106 tests passed (43.60s), 0 act / 0 act-environment / 0 router warnings.
  • Each run: 0 act warnings, 0 act-environment warnings, 0 router warnings.
  • Web typecheck passes (existing Effect refactoring suggestions only).
  • Lint on all 17 touched files passes with zero warnings, including t3code/require-disposable-render.
  • git diff --check passes.

Review follow-up validation: favicon test passed five consecutive browser runs with the default router; all seven files changed by the follow-up passed once. Touched-file lint and web typecheck pass.

Implementation: GPT-6.1 through the Codex harness.

🤖 Generated with Claude Code

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Oct 20, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 20, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 4213cba

Macroscope's review found this PR approvable — The PR migrates 17 browser-test files to disposable rendering and changes only ignored test-harness paths. Its impact is limited to test setup, cleanup, mocks, timers, and assertions, with no product runtime or default changes.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@macroscopeapp
macroscopeapp Bot dismissed their stale review October 20, 2026 10:37

Dismissing prior approval to re-evaluate 4213cba

@juliusmarminge
juliusmarminge merged commit 2ed4a36 into test/web-test-audit Oct 20, 2026
29 of 30 checks passed
@juliusmarminge
juliusmarminge deleted the test/web-migrate-5 branch October 20, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant