chore(skill): direct primitives to tests/display/ and reserve tests/utils/ for helpers#1049
Conversation
…tils/ for helpers Address feedback Copilot raised on the Spacer and Separator migration PRs: component specs were landing in tests/utils/ next to the shared getStoryUrl helper, which conflates test fixtures with test code. Codify in the skill: - tests/utils/ is reserved for shared helpers (getStoryUrl, etc.). - Primitives (Spacer, Separator, Text, Title, Label, GenericLabel, Icon, ...) belong in tests/display/. - New folders only for new component families, named for the family. - Sibling specs import getStoryUrl as `from '../utils'`. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Storybook Preview Deployed✅ Preview URL: https://click-gro4cpzdd-clickhouse.vercel.app Built from commit: |
There was a problem hiding this comment.
Pull request overview
Documentation-only change to the CSS Modules migration skill, clarifying where new Playwright specs should be placed so future migration PRs don't default to tests/utils/.
Changes:
- Adds explicit guidance that
tests/utils/is reserved for shared helpers only. - Directs display primitives (Spacer, Separator, Text, etc.) to
tests/display/and documents naming rules for new family folders. - Notes the sibling import path
from '../utils'forgetStoryUrl.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address Copilot's standing review feedback on the migration PRs: tests/utils/ is reserved for shared helpers like getStoryUrl; component specs belong in component-family folders. Migration skill updated in PR #1049 to codify this for future migrations. Visual regression remains byte-for-byte: 8/8 snapshots match without regeneration.
Address Copilot's standing review feedback on the migration PRs: tests/utils/ is reserved for shared helpers like getStoryUrl; component specs belong in component-family folders. Migration skill updated in PR #1049 to codify this for future migrations. Visual regression remains byte-for-byte: 37/37 snapshots match without regeneration.
Summary
Codify in the CSS Modules migration skill where component specs belong, so future migration PRs land in the right test folder on the first try.
Copilot raised the same observation on the Spacer (#1045) and Separator (#1046) review: those specs were placed under
tests/utils/, which is reserved for shared helpers likegetStoryUrl(tests/utils/index.ts). Component specs belong in component-family folders.Changes
<area>carefully" subsection in the skill explaining:tests/utils/is reserved for shared helpers — never put component specs there.tests/buttons/,tests/cards/) take precedence.tests/display/.tests/forms/,tests/overlays/), not the individual component.from '../utils'.Follow-ups (separate PRs)
Note
Low Risk
Documentation-only change to an internal migration skill; no runtime or test code modified.
Overview
Updates the component CSS Modules migration skill so commit 1’s Playwright spec path is chosen deliberately instead of defaulting to
tests/utils/.The skill now spells out that
tests/utils/is helpers-only (e.g.getStoryUrl), that existing families liketests/buttons/andtests/cards/should be reused when they fit, that display primitives (Spacer, Separator, Text, Icon, etc.) belong intests/display/, and that new folders should be named for a component family rather than a single component. It also documents importing shared helpers asfrom '../utils'from a sibling test folder.Reviewed by Cursor Bugbot for commit e946756. Bugbot is set up for automated code reviews on this repo. Configure here.