Skip to content

Commit 5249480

Browse files
committed
Refactor SetupPage stories
1 parent ae23444 commit 5249480

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed
Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
1-
import { action } from "@storybook/addon-actions";
2-
import { Story } from "@storybook/react";
3-
import { SetupPageView, SetupPageViewProps } from "./SetupPageView";
1+
import { SetupPageView } from "./SetupPageView";
42
import { mockApiError } from "testHelpers/entities";
3+
import type { Meta, StoryObj } from "@storybook/react";
54

6-
export default {
5+
const meta: Meta<typeof SetupPageView> = {
76
title: "pages/SetupPageView",
87
component: SetupPageView,
98
};
109

11-
const Template: Story<SetupPageViewProps> = (args: SetupPageViewProps) => (
12-
<SetupPageView {...args} />
13-
);
10+
export default meta;
11+
type Story = StoryObj<typeof SetupPageView>;
1412

15-
export const Ready = Template.bind({});
16-
Ready.args = {
17-
onSubmit: action("submit"),
18-
};
13+
export const Ready: Story = {};
1914

20-
export const FormError = Template.bind({});
21-
FormError.args = {
22-
onSubmit: action("submit"),
23-
error: mockApiError({
24-
validations: [{ field: "username", detail: "Username taken" }],
25-
}),
15+
export const FormError: Story = {
16+
args: {
17+
error: mockApiError({
18+
validations: [{ field: "username", detail: "Username taken" }],
19+
}),
20+
},
2621
};
2722

28-
export const Loading = Template.bind({});
29-
Loading.args = {
30-
onSubmit: action("submit"),
31-
isLoading: true,
23+
export const Loading: Story = {
24+
args: {
25+
isLoading: true,
26+
},
3227
};

0 commit comments

Comments
 (0)