Skip to content

fix(web): restore test harness compatibility - #664

Open
raiden202 wants to merge 1 commit into
Silo-Server:mainfrom
raiden202:pr/fix-web-ci-test-harness
Open

fix(web): restore test harness compatibility#664
raiden202 wants to merge 1 commit into
Silo-Server:mainfrom
raiden202:pr/fix-web-ci-test-harness

Conversation

@raiden202

@raiden202 raiden202 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Problem

The Web CI job on current main stops during typechecking because the intro-skip test stores an untyped Vitest mock where the hook requires a callable seek function. Once typechecking proceeds, two existing component test harnesses also fail: SeasonContent reaches the overlay preferences hook without its query context, and ServerStorageStep renders a Radix control without jsdom's missing ResizeObserver API.

Approach

Keep the fix test-only:

  • Give the intro seek mock its actual (seconds: number) => boolean signature.
  • Mock overlay preferences in the isolated SeasonContent unit test, which does not exercise overlay behavior.
  • Add the same local no-op ResizeObserver used by neighboring Radix component tests.

No production code, dependencies, or runtime behavior change.

Verification

  • pnpm run build passes.
  • pnpm run lint reports 0 errors and 151 existing warnings.
  • pnpm run format:check passes.
  • Focused tests: 19/19 pass across the three affected files.
  • Full web suite: 2,000/2,000 tests pass.
  • git diff --check origin/main...HEAD passes.
  • Diff, commit metadata, and PR text scans found no local paths, hostnames, credentials, or personal data.

Risks & follow-up

Low risk. This only restores the test environments and strengthens a mock type; application code is untouched.

After merge, PRs #336 and #368 can be rebased to pick up the fix and return their Web checks to green.

AI-use disclosure

Implemented with a combination of Claude Code and Codex assistance, with human oversight.

Summary by CodeRabbit

  • Tests
    • Improved test isolation for season content overlay preferences.
    • Added compatibility coverage for environments without ResizeObserver.
    • Updated mock typing for intro-skip prompt seeking tests.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 721adee9-41bd-411e-9708-aa694aa51aaa

📥 Commits

Reviewing files that changed from the base of the PR and between 8094513 and 95ace04.

📒 Files selected for processing (3)
  • web/src/pages/ItemDetail/SeasonContent.test.tsx
  • web/src/pages/setup-wizard/steps/ServerStorageStep.test.tsx
  • web/src/player/hooks/useIntroSkipPrompt.test.ts

Included review availability: Your plan includes up to 2 reviews per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR updates three frontend tests. It mocks overlay preferences, adds a conditional ResizeObserver stub, and explicitly types an onSeek mock.

Changes

Frontend test harness

Layer / File(s) Summary
Test environment support
web/src/pages/ItemDetail/SeasonContent.test.tsx, web/src/pages/setup-wizard/steps/ServerStorageStep.test.tsx
The tests isolate overlay preferences and provide a no-op ResizeObserver fallback when the global observer is unavailable.
Mock type precision
web/src/player/hooks/useIntroSkipPrompt.test.ts
The test explicitly types onSeek as a numeric-argument, boolean-returning Vitest mock.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 95ace

This change restores compatibility in three web test harnesses without changing application behavior, dependencies, or production configuration; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

Suggested reviewers: quick104

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the test-only changes that restore Web CI test harness compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant