Repository navigation
test: migrate Atoms out of styleguide into colocated stories as tests - #37
Conversation
Co-locate Rotation, ExpandInCollapseOut, and FadeInSlideOut stories into packages/gamut/src/Animation (behavior + a11y via play), and remove the old styleguide Animations folder. Also drop the now-empty Atoms About/AboutToC. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-locate Button atoms (ButtonExamples, CTAButton, FillButton, IconButton, StrokeButton, TextButton) as stories under Actions/Buttons, folding the old IconButton/TextButton node tests into play assertions. Add a variant argType + full variant/size matrix (with a labeled column) to the examples grid, and a storySort pinning Button Examples first in the folder. Remove the old styleguide Buttons folder and the Button __tests__. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-locate Badge, ProgressBar, RadialProgress, Shimmer, Spinner, and FeatureShimmer as stories under the Status category, with behavior/a11y assertions in play functions. Keep node tests only where a browser play can't reach: ProgressBar's useLogicalProperties width matrix and FeatureShimmer's reduced-motion hook mock (both co-located). Remove the old styleguide folders (Badge, ProgressBar, RadialProgress, FeatureShimmer, Loaders) and the Button-style __tests__ dirs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-locate the story under Navigation and move the href check into a play function. Remove the Jest test and the old styleguide story. Co-Authored-By: Grok 4.7 <noreply@x.ai> Co-authored-by: Cursor <cursoragent@cursor.com>
Co-locate both under Utilities, fold their Jest coverage into play functions, and remove the old styleguide stories and node tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-locate both under Containers. Fold the Card render tests and the Drawer expand/collapse tests into play functions, keep only the node-only useCardElevation logic, and add variant/shadow/borderRadius argTypes to Card. Remove the old styleguide stories. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-locate both under Actions and fold their Jest coverage into play functions (roles, callbacks, disabled states, aria-label), then remove the node tests and old styleguide stories. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-locate the story under Overlays and move the node tests out of __tests__ (PopoverContainer.test.tsx, hooks.test.tsx, testUtils.ts), excluding the test helper from the lib build. Disable FocusTrap autofocus in the catalog stories so the docs page no longer hijacks scroll, and remove the old styleguide story. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move the useCardElevation test to Card/Card.test.tsx to match the co-located convention used by the other migrated components. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@skillsoft/eslint-plugin-gamut
@skillsoft/gamut
@skillsoft/gamut-agent-tools
@skillsoft/gamut-icons
@skillsoft/gamut-illustrations
@skillsoft/gamut-patterns
@skillsoft/gamut-styles
@skillsoft/gamut-tests
@skillsoft/variance
commit: |
LinKCoding
left a comment
There was a problem hiding this comment.
looking good!
I think with this split of using stories as tests and still keeping some .test.tsx files, it'd be nice to have some documentation around testing for decision making or just general resources.
Also, is there a planned update for the gamut-testing skill?
| }, | ||
| }; | ||
|
|
||
| const AbsoluteBadge = styled(Badge)( |
There was a problem hiding this comment.
I think for a user, it'd be better to add an absolutely positioned box that wraps around Badge
that way Badge is used as is while the wrapper's purpose is the positioning
| const meta: Meta<typeof Toggle> = { | ||
| title: 'Actions/Toggle', | ||
| component: Toggle, | ||
| args: { |
There was a problem hiding this comment.
fixing separately!
@LinKCoding yup i have later tickets to update/add READMEs and skills! |

Summary
Migrates a batch of components out of the retiring
packages/styleguideinto co-located.stories.tsxfiles inpackages/gamut/src, as stories-as-tests under@storybook/addon-vitest. Stories are regrouped from the old Atoms/Molecules taxonomy into semantic sidebar categories that match the new docs site, behavioral coverage from the old Jest tests is folded into play functions, and node-only tests are kept co-located for concerns that can't run in the browser.Components migrated
What changed
title, relative imports, and play functions that assert the behavior the old Jest tests covered (roles, interactions, callbacks, disabled states, aria-labels).ProgressBar(width /useLogicalPropertiesmatrix),FeatureShimmer(reduced-motion hook mock),Card(useCardElevationtoken mapping), andPopoverContainer(positioning geometry, pure utils, scrolling-parent detection)..mdxdocs were removed. A few dead<LinkTo>references remain in other styleguide docs and resolve as styleguide retires.Notable per-component details
variantargType (radio) on the shared button atoms; the Button Examples grid shows every variant × size across light and dark.__tests__into co-locatedPopoverContainer.test.tsx/hooks.test.tsx/testUtils.ts(helper excluded from the lib build). Catalog stories passfocusOnProps={{ autoFocus: false }}so the docs page, which renders many always-open popovers, no longer hijacks scroll on load or click.variant/shadow/borderRadiusargTypes;borderRadiusdefault is documented as the component's conditionalisInteractive ? 'md' : 'none'.Testing
yarn test:stories— all migrated stories pass, including their a11y checks.yarn nx test gamut— the retained node Jest suites pass.yarn storybookand confirm:PR Checklist