Skip to content

Commit 788a7b2

Browse files
committed
chore: add story for failed refresh error
1 parent a1d3b82 commit 788a7b2

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

site/src/pages/UserSettingsPage/ExternalAuthPage/ExternalAuthPageView.stories.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
22
import {
33
MockGithubAuthLink,
44
MockGithubExternalProvider,
5+
MockGithubValidateErrorAuthLink,
56
} from "testHelpers/entities";
67
import { ExternalAuthPageView } from "./ExternalAuthPageView";
78

@@ -60,3 +61,17 @@ export const Unauthenticated: Story = {
6061
},
6162
},
6263
};
64+
65+
export const Failed: Story = {
66+
args: {
67+
...meta.args,
68+
auths: {
69+
providers: [MockGithubExternalProvider],
70+
links: [
71+
{
72+
...MockGithubValidateErrorAuthLink,
73+
},
74+
],
75+
},
76+
},
77+
};

site/src/testHelpers/entities.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3455,6 +3455,16 @@ export const MockGithubAuthLink: TypesGen.ExternalAuthLink = {
34553455
validate_error: "",
34563456
};
34573457

3458+
export const MockGithubValidateErrorAuthLink: TypesGen.ExternalAuthLink = {
3459+
provider_id: "github",
3460+
created_at: "",
3461+
updated_at: "",
3462+
has_refresh_token: true,
3463+
expires: "",
3464+
authenticated: false,
3465+
validate_error: "Failed to refresh token.",
3466+
};
3467+
34583468
export const MockOAuth2ProviderApps: TypesGen.OAuth2ProviderApp[] = [
34593469
{
34603470
id: "1",

0 commit comments

Comments
 (0)