# test\(web\): migrate browser tests to the disposable render helper \(8/8\) · PR \#22267 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/22267)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: test/web-migrate-8

Target branch: test/web-test-audit

Head commit: 4eb6aabc23d5760f2c10f40041157c8c908fb8eb

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/22267)

[Commits](https://git.cafe/pingdotgg/t3code/pull/22267/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/22267/diffs?format=markdown)

## Description

---

The last slice of apps/web browser tests still managed React roots, `act` and lifecycle hooks by hand, so `t3code/require-disposable-render` flagged them. This moves them onto the disposable render helper from #22187.

Each test now acquires its own render (and any fake timers, spies, storage cleanup or atom registry) with `using`/`await using`. Mock state read by `vi.mock` factories is reset by a `setup()` call at the top of each test. Assertions are unchanged, and the slice runs the same 69 tests as before.

## Files (chunk 8 of 8)
- `src/hooks/useHtmlRenderTheme.browser.test.tsx`
- `src/hooks/useLiveRefresh.browser.test.tsx`
- `src/hooks/useLocalStorage.hook.browser.test.tsx`
- `src/hooks/usePullRequestChecksRefresh.browser.test.tsx`
- `src/hooks/useResizableWidth.browser.test.tsx`
- `src/hooks/useSettings.favorites.browser.test.tsx`
- `src/hooks/useSettings.selector.browser.test.tsx`
- `src/hooks/useSettings.sync.browser.test.tsx`
- `src/hooks/useStableCallback.browser.test.tsx`
- `src/panelAnimations.browser.test.tsx`
- `src/state/queries.threadSearch.browser.test.tsx`
- `src/state/terminalSessionAvailability.browser.test.tsx`
- `src/state/usage.browser.test.tsx`

**Left unmigrated:** none.
**`router: false`:** none. Every file runs with the default test router, including the fake-timer and hand-stepped `requestAnimationFrame` tests.

One small structural change: `panelAnimations` now passes its `observed` array as a prop, so the probe's effect lists it as a dependency to satisfy `exhaustive-effect-dependencies`. The array is stable, so the effect still fires only when `suppressed` changes.

## Verification
`vp test run --project browser --reporter=verbose` on the 13 files, three consecutive runs:

| Run | Result | act warnings | act-environment warnings | router warnings |
| --- | --- | --- | --- | --- |
| 1 | 69/69 passed | 0 | 0 | 0 |
| 2 | 69/69 passed | 0 | 0 | 0 |
| 3 | 69/69 passed | 0 | 0 | 0 |

- `vp lint` on the 13 files: 0 warnings, including `t3code/require-disposable-render`
- `tsc-rs --noEmit` for apps/web: no errors
- No touched file imports jsdom, happy-dom or `react-dom/client`

Done by Claude Opus 5.5 in Claude Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

