Skip to content

perf(themed): speed up test helper#14832

Draft
jcfranco wants to merge 2 commits into
devfrom
jcfranco/improve-themed-runtime
Draft

perf(themed): speed up test helper#14832
jcfranco wants to merge 2 commits into
devfrom
jcfranco/improve-themed-runtime

Conversation

@jcfranco

@jcfranco jcfranco commented Jul 18, 2026

Copy link
Copy Markdown
Member

Related Issue: N/A

Summary

🧪🚀

@jcfranco
jcfranco requested a review from Copilot July 18, 2026 02:38
@github-actions github-actions Bot added the chore Issues with changes that don't modify src or test files. label Jul 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes the themed() browser test helper used across packages/components to validate CSS token theming, aiming to reduce repeated interaction setup work during theme assertions.

Changes:

  • Precomputes per-target assertion metadata (resolved elements, pseudo-element info, interaction targets) via createThemeAssertion().
  • Groups themed assertions by interaction element + state, performing the interaction once per group and asserting multiple properties afterward.
  • Simplifies selector handling and consolidates repeated “target not found” error messaging.

Comment on lines 116 to 120
it("is themeable", async () => {
const { el, container } = await setup();
const elLocator = page.elementLocator(el);
await userEvent.unhover(el);

preventClicks(container);

Comment thread packages/components/src/tests/commonTests/browser/themed.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jcfranco jcfranco added the skip visual snapshots Pull requests that do not need visual regression testing. label Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Issues with changes that don't modify src or test files. skip visual snapshots Pull requests that do not need visual regression testing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants