Skip to content

Commit ce461c3

Browse files
committed
Refactor StarterTemplatePageView stories
1 parent 5249480 commit ce461c3

File tree

2 files changed

+24
-46
lines changed

2 files changed

+24
-46
lines changed

site/src/pages/StarterTemplatePage/StarterTemplatePage.test.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
1-
import { Story } from "@storybook/react";
21
import {
32
mockApiError,
43
MockOrganization,
54
MockTemplateExample,
65
} from "testHelpers/entities";
7-
import {
8-
StarterTemplatePageView,
9-
StarterTemplatePageViewProps,
10-
} from "./StarterTemplatePageView";
6+
import { StarterTemplatePageView } from "./StarterTemplatePageView";
7+
8+
import type { Meta, StoryObj } from "@storybook/react";
119

12-
export default {
10+
const meta: Meta<typeof StarterTemplatePageView> = {
1311
title: "pages/StarterTemplatePageView",
1412
component: StarterTemplatePageView,
1513
};
1614

17-
const Template: Story<StarterTemplatePageViewProps> = (args) => (
18-
<StarterTemplatePageView {...args} />
19-
);
15+
export default meta;
16+
type Story = StoryObj<typeof StarterTemplatePageView>;
2017

21-
export const Default = Template.bind({});
22-
Default.args = {
23-
context: {
24-
exampleId: MockTemplateExample.id,
25-
organizationId: MockOrganization.id,
26-
error: undefined,
27-
starterTemplate: MockTemplateExample,
18+
export const Default: Story = {
19+
args: {
20+
context: {
21+
exampleId: MockTemplateExample.id,
22+
organizationId: MockOrganization.id,
23+
error: undefined,
24+
starterTemplate: MockTemplateExample,
25+
},
2826
},
2927
};
30-
31-
export const Error = Template.bind({});
32-
Error.args = {
33-
context: {
34-
exampleId: MockTemplateExample.id,
35-
organizationId: MockOrganization.id,
36-
error: mockApiError({
37-
message: `Example ${MockTemplateExample.id} not found.`,
38-
}),
39-
starterTemplate: undefined,
28+
export const Error: Story = {
29+
args: {
30+
context: {
31+
exampleId: MockTemplateExample.id,
32+
organizationId: MockOrganization.id,
33+
error: mockApiError({
34+
message: `Example ${MockTemplateExample.id} not found.`,
35+
}),
36+
starterTemplate: undefined,
37+
},
4038
},
4139
};

0 commit comments

Comments
 (0)