Skip to content

frontend: Resource/DeleteButton: Add missing Storybook stories #5892

@sudhidutta7694

Description

@sudhidutta7694

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions