Skip to content

test(styleguide): skip tests on full icon, illustration, pattern galleries - #17

Open
aresnik11 wants to merge 1 commit into
mainfrom
ajr-hide-asset-tests
Open

aresnik11 wants to merge 1 commit into
mainfrom
ajr-hide-asset-tests

Conversation

@aresnik11

@aresnik11 aresnik11 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Skip render/a11y tests on the full asset gallery stories

The icon/illustration/pattern "gallery" stories each render every asset in the set and then run axe over all of them. Under @storybook/addon-vitest that's slow and low-value — each catalog is redundant with its component's Default story. This excludes just the galleries from the test run while keeping them browsable in Storybook.

What changed

Added tags: ['!test'] to the gallery stories:

  • Icons/MiniAllMiniIcons
  • Icons/RegularRegularInterfaceIcons, RegularLearningEnvironmentIcons, RegularVendorIcons, RegularSkillIcons
  • IllustrationsAllIllustrations
  • PatternsAllPatterns

How it works

Storybook auto-applies a test tag to every story, and addon-vitest runs the tagged ones. tags: ['!test'] removes that tag from a single story, so the test run ignores it — a per-story opt-out. The stories still render normally in yarn start:storybook; only the automated render + a11y check is skipped. Each component's Default (representative) story still runs, so the component itself stays covered.

Effect on the run

Test count per file drops to just Default:

  • Mini 2 → 1, Regular 5 → 1, Illustrations 2 → 1, Patterns 2 → 1

That removes the slowest, most-redundant stories from the Vitest sweep.

Testing instructions

# 1. Each gallery file should now report a single test (Default only)
yarn test:stories Mini Regular Illustrations Patterns
#    → expect "1 test" per file; the All* / gallery stories are not executed

Also confirm they're still visible in the UI: yarn start:storybook → the gallery stories (AllMiniIcons, AllIllustrations, AllPatterns, the Regular icon galleries) still render in the sidebar and canvas; they're just absent from the test run.

PR Checklist

  • Related to designs:
  • Related to JIRA ticket: GMT-1793
  • Version plan added/updated (or not needed)
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions tests for the code change
  • The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

…and pattern galleries

The gallery stories (AllMiniIcons, the Regular icon galleries, AllIllustrations,
AllPatterns) render every asset and run axe over all of them — slow and
redundant with each component's Default story, and the source of the flaky
contrast failures. Add tags: ['!test'] so addon-vitest skips them; they still
render in Storybook for browsing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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