buster/web/.cursor/rules/components_ui_stories.mdc

12 lines
871 B
Plaintext
Raw Normal View History

2025-02-25 10:45:41 +08:00
---
description: Rules for new stories
globs: src/components/**/*.stories.tsx
2025-02-27 23:38:44 +08:00
alwaysApply: false
2025-02-25 10:45:41 +08:00
---
2025-03-02 06:21:58 +08:00
- All new stories title with "UI/directory/{componentName}" unless specified otherwise.
- Instead of console log for click events, you should do native storybook actions
- If a new story is made in the controller directory, I would like it title "Controllers/{controller name or parent controller name}/{componentName}"
2025-03-04 01:35:57 +08:00
- If a new story is found in the features directory, I would like it titled "Features/{featureName or parent feature name}/{componentName}"
2025-03-04 02:46:51 +08:00
- onClick events (or similar) should be mocked with fn() from the storybook test package
- If I ever need to mock an endpoint you should use msw, All endpoints should be appended with the NEXT_PUBLIC_API_URL from env. For example: http.get(`${process.env.NEXT_PUBLIC_API_URL}/api/v1/datasets`, () => {