Skip to content

Commit 35978ed

Browse files
committed
Add types to oauth2 stories
1 parent 430140e commit 35978ed

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/CreateOAuth2AppPageView.stories.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
import { CreateOAuth2AppPageView } from "./CreateOAuth2AppPageView";
1+
import type { StoryObj } from "@storybook/react";
22
import { mockApiError } from "testHelpers/entities";
3+
import { CreateOAuth2AppPageView } from "./CreateOAuth2AppPageView";
34

45
export default {
56
title: "pages/DeploySettingsPage/CreateOAuth2AppPageView",
67
component: CreateOAuth2AppPageView,
78
};
89

9-
export const Updating = {
10+
type Story = StoryObj<typeof CreateOAuth2AppPageView>;
11+
12+
export const Updating: Story = {
1013
args: {
1114
isUpdating: true,
1215
},
1316
};
1417

15-
export const Error = {
18+
export const Error: Story = {
1619
args: {
1720
error: mockApiError({
1821
message: "Validation failed",
@@ -34,7 +37,7 @@ export const Error = {
3437
},
3538
};
3639

37-
export const Default = {
40+
export const Default: Story = {
3841
args: {
3942
// Nothing.
4043
},

site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/EditOAuth2AppPageView.stories.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
1-
import { EditOAuth2AppPageView } from "./EditOAuth2AppPageView";
1+
import type { StoryObj } from "@storybook/react";
22
import {
33
MockOAuth2Apps,
44
MockOAuth2AppSecrets,
55
mockApiError,
66
} from "testHelpers/entities";
7+
import { EditOAuth2AppPageView } from "./EditOAuth2AppPageView";
78

89
export default {
910
title: "pages/DeploySettingsPage/EditOAuth2AppPageView",
1011
component: EditOAuth2AppPageView,
1112
};
1213

13-
export const LoadingApp = {
14+
type Story = StoryObj<typeof EditOAuth2AppPageView>;
15+
16+
export const LoadingApp: Story = {
1417
args: {
1518
isLoadingApp: true,
1619
},
1720
};
1821

19-
export const LoadingSecrets = {
22+
export const LoadingSecrets: Story = {
2023
args: {
2124
app: MockOAuth2Apps[0],
2225
isLoadingSecrets: true,
2326
},
2427
};
2528

26-
export const Error = {
29+
export const Error: Story = {
2730
args: {
2831
app: MockOAuth2Apps[0],
2932
secrets: MockOAuth2AppSecrets,
@@ -47,7 +50,7 @@ export const Error = {
4750
},
4851
};
4952

50-
export const Default = {
53+
export const Default: Story = {
5154
args: {
5255
app: MockOAuth2Apps[0],
5356
secrets: MockOAuth2AppSecrets,
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
import OAuth2AppsSettingsPageView from "./OAuth2AppsSettingsPageView";
1+
import type { StoryObj } from "@storybook/react";
22
import { MockOAuth2Apps } from "testHelpers/entities";
3+
import OAuth2AppsSettingsPageView from "./OAuth2AppsSettingsPageView";
34

45
export default {
56
title: "pages/DeploySettingsPage/OAuth2AppsSettingsPageView",
67
component: OAuth2AppsSettingsPageView,
78
};
89

9-
export const Loading = {
10+
type Story = StoryObj<typeof OAuth2AppsSettingsPageView>;
11+
12+
export const Loading: Story = {
1013
args: {
1114
isLoading: true,
1215
},
1316
};
1417

15-
export const Unentitled = {
18+
export const Unentitled: Story = {
1619
args: {
1720
isLoading: false,
1821
apps: MockOAuth2Apps,
1922
},
2023
};
2124

22-
export const Entitled = {
25+
export const Entitled: Story = {
2326
args: {
2427
isLoading: false,
2528
apps: MockOAuth2Apps,
2629
isEntitled: true,
2730
},
2831
};
2932

30-
export const Empty = {
33+
export const Empty: Story = {
3134
args: {
3235
isLoading: false,
33-
apps: null,
3436
},
3537
};

0 commit comments

Comments
 (0)