|
| 1 | +import { Meta, StoryObj } from "@storybook/react"; |
| 2 | +import { within } from "@storybook/test"; |
| 3 | + |
| 4 | +import { destructionListFactory } from "../../fixtures/destructionList"; |
| 5 | +import { DestructionListStatusBadge } from "./DestructionListStatusBadge"; |
| 6 | + |
| 7 | +const meta: Meta<typeof DestructionListStatusBadge> = { |
| 8 | + title: "Components/DestructionListStatusBadge", |
| 9 | + component: DestructionListStatusBadge, |
| 10 | +}; |
| 11 | + |
| 12 | +export default meta; |
| 13 | +type Story = StoryObj<typeof meta>; |
| 14 | + |
| 15 | +export const DestructionListStatusNew: Story = { |
| 16 | + args: { |
| 17 | + destructionList: destructionListFactory({ status: "new" }), |
| 18 | + }, |
| 19 | + play: async ({ canvasElement }) => { |
| 20 | + await within(canvasElement).findByText("Nieuw"); |
| 21 | + }, |
| 22 | +}; |
| 23 | + |
| 24 | +export const DestructionListStatusChangesRequested: Story = { |
| 25 | + args: { |
| 26 | + destructionList: destructionListFactory({ status: "changes_requested" }), |
| 27 | + }, |
| 28 | + play: async ({ canvasElement }) => { |
| 29 | + await within(canvasElement).findByText("Wijzigingen aangevraagd"); |
| 30 | + }, |
| 31 | +}; |
| 32 | + |
| 33 | +export const DestructionListStatusReadyToReview: Story = { |
| 34 | + args: { |
| 35 | + destructionList: destructionListFactory({ status: "ready_to_review" }), |
| 36 | + }, |
| 37 | + play: async ({ canvasElement }) => { |
| 38 | + await within(canvasElement).findByText("Klaar voor beoordeling"); |
| 39 | + }, |
| 40 | +}; |
| 41 | + |
| 42 | +export const DestructionListStatusInternallyReviewed: Story = { |
| 43 | + args: { |
| 44 | + destructionList: destructionListFactory({ status: "internally_reviewed" }), |
| 45 | + }, |
| 46 | + play: async ({ canvasElement }) => { |
| 47 | + await within(canvasElement).findByText("Intern beoordeeld"); |
| 48 | + }, |
| 49 | +}; |
| 50 | + |
| 51 | +export const DestructionListStatusReadyForArchivist: Story = { |
| 52 | + args: { |
| 53 | + destructionList: destructionListFactory({ status: "ready_for_archivist" }), |
| 54 | + }, |
| 55 | + play: async ({ canvasElement }) => { |
| 56 | + await within(canvasElement).findByText("Klaar voor archivaris"); |
| 57 | + }, |
| 58 | +}; |
| 59 | + |
| 60 | +export const DestructionListStatusReadyToDelete: Story = { |
| 61 | + args: { |
| 62 | + destructionList: destructionListFactory({ status: "ready_to_delete" }), |
| 63 | + }, |
| 64 | + play: async ({ canvasElement }) => { |
| 65 | + await within(canvasElement).findByText("Klaar om te vernietigen"); |
| 66 | + }, |
| 67 | +}; |
| 68 | + |
| 69 | +export const DestructionListStatusDeleted: Story = { |
| 70 | + args: { |
| 71 | + destructionList: destructionListFactory({ status: "deleted" }), |
| 72 | + }, |
| 73 | + play: async ({ canvasElement }) => { |
| 74 | + await within(canvasElement).findByText("Vernietigd"); |
| 75 | + }, |
| 76 | +}; |
0 commit comments