You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. **Element not found**: Use proper async queries (`findBy*`)
377
+
2. **Timing issues**: Add appropriate waits for async operations
378
+
3. **Form submission failures**: Verify fetcher setup and router configuration
379
+
4. **Port conflicts**: Use the custom static server solution
380
+
381
+
## Verification Checklist
220
382
When creating or modifying Storybook tests, ensure:
221
383
222
384
1. ✅ Story includes all three test phases (default, invalid, valid)
@@ -227,19 +389,21 @@ When creating or modifying Storybook tests, ensure:
227
389
6. ✅ Includes proper error handling and success scenarios
228
390
7. ✅ Story serves as both documentation and test
229
391
8. ✅ Component is properly isolated and focused
392
+
9. ✅ Tests complete in reasonable time (< 10 seconds)
393
+
10. ✅ Uses semantic queries for better maintainability
230
394
231
-
## Common Pitfalls to Avoid
232
-
- Port conflicts (6006 already in use) - kill existing processes
233
-
- Missing Playwright system dependencies - run `npx playwright install-deps`
234
-
- Test timeouts - add delays for complex async operations
235
-
- Element not found errors - ensure proper async handling
236
-
- Form submission issues - verify fetcher setup and decorator usage
395
+
## Team Workflow Integration
237
396
238
-
## Advanced Patterns
239
-
- Create reusable test utilities in `apps/docs/src/lib/test-utils.ts`
240
-
- Use story composition for different scenarios
241
-
- Implement mock data factories for consistent test data
242
-
- Group related stories with shared decorators
397
+
### Code Review Guidelines
398
+
- Verify test coverage includes happy path and error scenarios
399
+
- Ensure stories are self-documenting and demonstrate component usage
400
+
- Check that tests follow established patterns and conventions
401
+
- Validate that new tests don't introduce flaky behavior
243
402
244
-
Remember: Every story should test real user workflows and serve as living documentation. Focus on behavior, not implementation details.
403
+
### Local Development Focus
404
+
- This setup is designed for local development and Codegen testing
405
+
- Tests run against built Storybook static files for consistency
406
+
- Custom server resolves common port conflicts in development environments
407
+
- Fast feedback loop optimized for developer productivity
245
408
409
+
Remember: Every story should test real user workflows and serve as living documentation. Focus on behavior, not implementation details. The testing infrastructure should be reliable, fast, and easy to maintain for local development and Codegen workflows.
0 commit comments