Skip to content

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

Merged
aresnik11 merged 1 commit into
mainfrom
ajr-hide-asset-tests
Sep 21, 2026
Merged

aresnik11 merged 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>

@sh0ji sh0ji left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice, I noticed these failed in #20: https://github.com/Codecademy/skillsoft-gamut/actions/runs/35644324274/job/106480969971. I say we just merge it and then I can pull this into my PR

@aresnik11

Copy link
Copy Markdown
Contributor Author

nice, I noticed these failed in #20: https://github.com/Codecademy/skillsoft-gamut/actions/runs/35644324274/job/106480969971. I say we just merge it and then I can pull this into my PR

@sh0ji yeah its actually because the skip animations fix i added to vite setup isnt pulled into ci yet. i have another PR to update that

@aresnik11
aresnik11 merged commit 5270372 into main Sep 21, 2026
1 check passed
@aresnik11
aresnik11 deleted the ajr-hide-asset-tests branch September 21, 2026 20:01
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