Skip to content

Commit 1618d36

Browse files
committed
Refactor SecuritySettingsPageView stories
1 parent 8f654b6 commit 1618d36

File tree

1 file changed

+46
-31
lines changed

1 file changed

+46
-31
lines changed
Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import { ComponentMeta, Story } from "@storybook/react";
2-
import { DeploymentOption } from "api/types";
3-
import {
4-
SecuritySettingsPageView,
5-
SecuritySettingsPageViewProps,
6-
} from "./SecuritySettingsPageView";
1+
import { DeploymentGroup, DeploymentOption } from "api/types";
2+
import { SecuritySettingsPageView } from "./SecuritySettingsPageView";
3+
import type { Meta, StoryObj } from "@storybook/react";
74

8-
export default {
5+
const group: DeploymentGroup = {
6+
name: "Networking",
7+
description: "",
8+
children: [] as DeploymentGroup[],
9+
};
10+
11+
const meta: Meta<typeof SecuritySettingsPageView> = {
912
title: "pages/SecuritySettingsPageView",
1013
component: SecuritySettingsPageView,
1114
args: {
@@ -14,50 +17,62 @@ export default {
1417
name: "SSH Keygen Algorithm",
1518
description: "something",
1619
value: "1234",
20+
group,
21+
flag: "derp",
22+
flag_shorthand: "d",
23+
hidden: false,
1724
},
1825
{
1926
name: "Secure Auth Cookie",
2027
description: "something",
2128
value: "1234",
29+
flag: "derp",
30+
flag_shorthand: "d",
31+
hidden: false,
2232
},
2333
{
2434
name: "Disable Owner Workspace Access",
2535
description: "something",
2636
value: false,
37+
flag: "derp",
38+
flag_shorthand: "d",
39+
hidden: false,
2740
},
2841
{
2942
name: "TLS Version",
3043
description: "something",
3144
value: ["something"],
32-
group: {
33-
name: "TLS",
34-
},
45+
group: { ...group, name: "TLS" },
46+
flag: "derp",
47+
flag_shorthand: "d",
48+
hidden: false,
3549
},
3650
],
3751
featureAuditLogEnabled: true,
3852
featureBrowserOnlyEnabled: true,
3953
},
40-
} as ComponentMeta<typeof SecuritySettingsPageView>;
54+
};
4155

42-
const Template: Story<SecuritySettingsPageViewProps> = (args) => (
43-
<SecuritySettingsPageView {...args} />
44-
);
45-
export const Page = Template.bind({});
56+
export default meta;
57+
type Story = StoryObj<typeof SecuritySettingsPageView>;
4658

47-
export const NoTLS = Template.bind({});
48-
NoTLS.args = {
49-
options: [
50-
{
51-
name: "SSH Keygen Algorithm",
52-
value: "1234",
53-
} as DeploymentOption,
54-
{
55-
name: "Disable Owner Workspace Access",
56-
value: false,
57-
} as DeploymentOption,
58-
{
59-
name: "Secure Auth Cookie",
60-
value: "1234",
61-
} as DeploymentOption,
62-
],
59+
export const Page: Story = {};
60+
61+
export const NoTLS = {
62+
args: {
63+
options: [
64+
{
65+
name: "SSH Keygen Algorithm",
66+
value: "1234",
67+
} as DeploymentOption,
68+
{
69+
name: "Disable Owner Workspace Access",
70+
value: false,
71+
} as DeploymentOption,
72+
{
73+
name: "Secure Auth Cookie",
74+
value: "1234",
75+
} as DeploymentOption,
76+
],
77+
},
6378
};

0 commit comments

Comments
 (0)