Skip to content

Chore/3399 add vitest visual testing support to components repo#3410

Open
a11ymiko wants to merge 14 commits into
mainfrom
chore/3399_add_vitest_visual_testing_support_to_components_repo
Open

Chore/3399 add vitest visual testing support to components repo#3410
a11ymiko wants to merge 14 commits into
mainfrom
chore/3399_add_vitest_visual_testing_support_to_components_repo

Conversation

@a11ymiko

@a11ymiko a11ymiko commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 3, 2026 08:01
@changeset-bot

changeset-bot Bot commented Jun 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e7d19f0

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

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

Adds Vitest-based visual regression testing support to the components monorepo by introducing the Chromatic Vitest integration and a first example visual spec, wired into the repo’s existing multi-project Vitest setup and Wireit scripts.

Changes:

  • Adds a new visual Vitest project that runs visual/*.visual.spec.ts with @chromatic-com/vitest’s chromaticPlugin().
  • Introduces Wireit scripts (test:visual, test:visual:ci) and a sample visual spec for sl-menu-button.
  • Updates yarn.lock to include the new Chromatic Vitest dependency tree.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
yarn.lock Adds lockfile entries for @chromatic-com/vitest and transitive deps.
vitest.config.ts Adds a visual Vitest project and loads chromaticPlugin().
visual/menu-button.visual.spec.ts New visual regression spec exercising the menu-button story + interactions.
package.json Adds Wireit tasks for visual tests and installs @chromatic-com/vitest.

Comment thread package.json
Comment thread package.json
Comment thread package.json
Comment thread visual/menu-button.visual.spec.ts Outdated
Copilot AI review requested due to automatic review settings June 3, 2026 10:16

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

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Comment thread vitest.config.ts
Comment thread visual/menu-button.visual.spec.ts Outdated
Comment thread visual/menu-button.visual.spec.ts
Comment thread .github/workflows/chromatic.yml
Comment thread package.json Outdated
@a11ymiko a11ymiko marked this pull request as ready for review June 3, 2026 10:26
@a11ymiko a11ymiko marked this pull request as draft June 3, 2026 10:33
@a11ymiko a11ymiko marked this pull request as ready for review June 3, 2026 10:54
Copilot AI review requested due to automatic review settings June 3, 2026 10:54

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

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Comment thread vitest.config.ts
Comment thread visual/menu-button.visual.spec.ts Outdated
Comment thread visual/menu-button.visual.spec.ts Outdated
Comment thread visual/menu-button.visual.spec.ts Outdated
Comment thread .github/workflows/chromatic.yml
@a11ymiko a11ymiko marked this pull request as draft June 3, 2026 12:15
@a11ymiko a11ymiko marked this pull request as ready for review June 3, 2026 13:56
Copilot AI review requested due to automatic review settings June 3, 2026 13:56
@a11ymiko a11ymiko marked this pull request as draft June 3, 2026 14:01

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

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Comment thread vitest.config.ts
Comment thread package.json
Comment thread visual/menu-button.visual.spec.ts Outdated
@a11ymiko a11ymiko marked this pull request as ready for review June 5, 2026 06:46
Copilot AI review requested due to automatic review settings June 5, 2026 06:46

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

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Comment thread vitest.config.ts
Comment thread package.json
Comment thread visual/menu-button.visual.spec.ts Outdated
Copilot AI review requested due to automatic review settings June 5, 2026 07:30

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

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Comment thread vitest.config.ts
Comment thread visual/menu-button.visual.spec.ts Outdated
Comment thread package.json
Copilot AI review requested due to automatic review settings June 5, 2026 13:30

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

Copilot reviewed 4 out of 5 changed files in this pull request and generated 6 comments.

Comment thread visual/menu-button.visual.spec.ts Outdated
Comment thread visual/menu-button.visual.spec.ts Outdated
Comment thread visual/menu-button.visual.spec.ts Outdated
Comment thread package.json
Comment thread vitest.config.ts
Comment thread .github/workflows/chromatic.yml
@a11ymiko a11ymiko marked this pull request as draft June 5, 2026 13:44
Copilot AI review requested due to automatic review settings June 8, 2026 11:52
@a11ymiko a11ymiko marked this pull request as ready for review June 8, 2026 11:55

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

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

Comment on lines +74 to +78
- name: Upload Vitest archives to Chromatic
run: yarn exec chromatic --vitest --project-token=${{ secrets.CHROMATIC_TOKEN_VISUAL }}
env:
CHROMATIC_SHA: ${{ github.sha }}
CHROMATIC_BRANCH: ${{ github.ref_name }}
Comment thread package.json
Comment on lines +384 to +387
"files": [
".storybook/vitest.setup.ts",
"visual/**/*.visual.spec.ts"
]
Comment thread package.json
Comment on lines +396 to +399
"files": [
".storybook/vitest.setup.ts",
"visual/**/*.visual.spec.ts"
]
Comment on lines +54 to +69
const waitForPopoverState = async (menu: MenuElement, expectedOpen: boolean) => {
let attempts = 0;

while (attempts < 50) {
const isOpen = menu.matches(':popover-open');
if (isOpen === expectedOpen) {
return;
}

await new Promise(resolve => requestAnimationFrame(resolve));
attempts++;
}

throw new Error(
`Timed out waiting for menu popover state "${expectedOpen ? 'open' : 'closed'}".`
);
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.

2 participants