Skip to content

Commit 89b49ff

Browse files
docs(components): add test file to new component workflow
Add a test-file step to "When Adding New Components" and the Component Development Checklist, so new components ship with a ComponentName.test.tsx from day one instead of as a follow-up. Closes #214
1 parent b2fa65c commit 89b49ff

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/components/CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ If the finding needs real work, open a dedicated issue and link it next to the c
187187
- Main component file: `YourComponent.tsx`
188188
- Types file: `YourComponent.types.ts` (if complex)
189189
- Styles using `EDSStyleSheet.create`
190+
- Test file: `YourComponent.test.tsx` — write it alongside the component, not as a follow-up. See `Divider.test.tsx` for the minimal shape: render via `test-utils` (wraps `@testing-library/react-native` with `EDSProvider`) and assert it renders plus any accessibility basics.
190191
2. Export from `src/index.ts`
191192
3. Add storybook story in `../../apps/storybook/app/(tabs)/YourComponent.tsx`
192193
4. Create developer documentation in `docs/YourComponent.mdx` — run `/document-component` for the full workflow and structure
@@ -217,6 +218,7 @@ If the finding needs real work, open a dedicated issue and link it next to the c
217218
- [ ] Exports TypeScript types for all props
218219
- [ ] Follows existing component patterns (prop naming, structure)
219220
- [ ] Has corresponding storybook story for visual testing
221+
- [ ] Has a `YourComponent.test.tsx` covering rendering and accessibility basics
220222
- [ ] Has developer MDX doc in `docs/` (Features → Usage → Examples → Props → Accessibility → Related components)
221223

222224
## Important Patterns

0 commit comments

Comments
 (0)