Skip to content

Build the reduced-motion mocks from the real media query list - #442

Merged
zuurbr merged 1 commit into
mainfrom
reduced-motion-mock-listeners
Nov 20, 2026
Merged

zuurbr merged 1 commit into
mainfrom
reduced-motion-mock-listeners

Conversation

@zuurbr

@zuurbr zuurbr commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

The npm update in #430 brings a typescript-eslint that flags the deprecated MediaQueryList addListener and removeListener. The two reduced-motion tests spelled those out in hand-built matchMedia mocks, so lint fails and the update cannot merge.

The mocks now take the browser's own MediaQueryList and only force its matches, as native-mode.test.ts and pixel-ratio.test.ts already do. The tests still check that a long name stays still and shows whole in a tip for a user who asked for reduced motion.

Verified: lint, typecheck, format and both tests on Chromium and WebKit, with the current packages and with #430's.

Once this merges, #430 can be rebased and merged.

The npm update in #430 brings a typescript-eslint that flags the
deprecated MediaQueryList addListener and removeListener, which the two
reduced-motion tests spelled out in hand-built matchMedia mocks, so lint
failed and the update could not merge.

The mocks now take the browser's own MediaQueryList and only force its
matches, so they name no deprecated member and keep the real listener
methods. The tests check the same thing as before: a long name stays
still and shows whole in a tip for a user who asked for reduced motion.

Verified with lint, typecheck and the two tests on Chromium and WebKit,
both with the current packages and with those of the update.
@zuurbr
zuurbr enabled auto-merge November 20, 2026 16:51
@github-actions

Copy link
Copy Markdown

AI review: no Important findings

The change touches two app tests, ui/tests/app/long-names.test.ts and ui/tests/app/track-list.test.ts. Their prefers-reduced-motion mock used to return a hand-built fake; it now wraps the browser's real MediaQueryList and overrides only matches, and no product code changes. All three specialists (correctness, rules and tests) reviewed the diff and found nothing.

Fix or answer each Important finding. A maintainer can comment /ai-review to review again, or /ai-review waive <reason> to pass the check.

@zuurbr
zuurbr added this pull request to the merge queue Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2026
@zuurbr
zuurbr added this pull request to the merge queue Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2026
@zuurbr
zuurbr added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 6545d0e Nov 20, 2026
38 checks passed
@zuurbr
zuurbr deleted the reduced-motion-mock-listeners branch November 20, 2026 23:33
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