Description
This issue corresponds to #931 , which aims to improve Storybook coverage for Headlamp components.
DeleteButton.stories.tsx does not currently exist for DeleteButton.
Component: frontend/src/components/common/Resource/DeleteButton.tsx
Current coverage: 42.85%
Suggestion
Create frontend/src/components/common/Resource/DeleteButton.stories.tsx covering the following states:
Default — delete button in its default enabled state
Confirmation dialog — dialog shown when the delete button is clicked, asking the user to confirm deletion
Delete in progress — loading state while the delete operation is being performed
Delete success — feedback shown after a successful deletion
Delete error — error state when deletion fails, with a retry option
The stories file goes alongside the existing component in the same directory:
frontend/src/components/common/Resource/DeleteButton.tsx
frontend/src/components/common/Resource/DeleteButton.stories.tsx
frontend/src/components/common/Resource/__snapshots__/ ← generated by tests
To generate coverage report:
cd frontend && npm run test -- --coverage
To generate/update snapshots:
cd frontend && npm run test -- -u
References
Parent issue: Stories for components #931
Example story structure to follow: src/components/common/ActionButton
How to view stories locally: cd frontend && npm run storybook
Description
This issue corresponds to #931, which aims to improve Storybook coverage for Headlamp components.
DeleteButton.stories.tsxdoes not currently exist forDeleteButton.Component:
frontend/src/components/common/Resource/DeleteButton.tsxCurrent coverage: 42.85%
Suggestion
Create
frontend/src/components/common/Resource/DeleteButton.stories.tsxcovering the following states:The stories file goes alongside the existing component in the same directory:
To generate coverage report:
To generate/update snapshots:
References
src/components/common/ActionButtoncd frontend && npm run storybook