Skip to content

test: wait for hero motion preference events - #1428

Merged
tannerlinsley merged 1 commit into
mainfrom
taren/hero-preference-test-sync
Oct 26, 2026
Merged

tannerlinsley merged 1 commit into
mainfrom
taren/hero-preference-test-sync

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

The hero media browser test could observe Chrome pausing hidden autoplay video before the reduced-motion change event reached the component. Switching the preference back immediately could then coalesce the events and fail the assertion that playback stays paused.

Wait for each media-query change event before advancing the test. This restores the synchronization from the earlier Redact branch that was absent from its final rewritten commit. Production code and existing playback assertions are unchanged.

Validation: full pnpm test passed, including TypeScript, lint, unit, chat and desktop checks. The hero browser fixture passed. git diff --check passed.

Summary by CodeRabbit

  • Tests
    • Improved browser-test reliability when checking video behavior under reduced-motion settings. Tests now wait for the preference change to be observed before verifying whether video playback is paused. No user-facing behavior changes are included in this update.

@changeset-bot

changeset-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a1a3dd9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4b4abf85-bed4-47ec-9923-cc02932357d8
Commits

Reviewing files that changed from the base of the PR and between 766437e and a1a3dd9.

Files selected for processing: 1
  • tests/hero-media.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

The hero media browser test now records prefers-reduced-motion change events and waits for the expected match state after each emulated preference change before checking video pause behavior.

Changes: Hero media test

Layer / File(s) Summary
Record and await preference changes
tests/hero-media.test.ts
The test records the reduced-motion match state in a document dataset attribute. It waits for the matching state after enabling and restoring the preference. This replaces checks that ran without waiting for the change events.

Priority: Low

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

Change: Other

Possibly related PRs

Suggested reviewers: benjavicente

Merge Risk: Minimal · up to a1a3d

The test synchronization change is narrowly scoped and introduces no established merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: the hero media test waits for motion preference events.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com a1a3dd9 Commit Preview URL

Branch Preview URL
Oct 26 2026, 06:11 AM

@tannerlinsley
tannerlinsley merged commit 1f9be91 into main Oct 26, 2026
8 checks passed
@tannerlinsley
tannerlinsley deleted the taren/hero-preference-test-sync branch October 26, 2026 06:19
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