fix(frontend): fix Storybook type errors (#13779)

* fix(frontend): fix Storybook type errors

* fix: `hasReduce` doesn't work in args
This commit is contained in:
zyoshoka 2024-05-01 16:39:16 +09:00 committed by GitHub
parent d2a5bb39e3
commit 9c057e6854
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 952 additions and 732 deletions

View file

@ -51,13 +51,16 @@ export const Empty = {
expect(buttons.at(-1)).toBeEnabled();
},
args: {
// @ts-expect-error serverRules is for test
serverRules: [],
tosUrl: null,
},
decorators: [
(_, context) => ({
setup() {
// @ts-expect-error serverRules is for test
instance.serverRules = context.args.serverRules;
// @ts-expect-error tosUrl is for test
instance.tosUrl = context.args.tosUrl;
onBeforeUnmount(() => {
// FIXME: 呼び出されない
@ -76,6 +79,7 @@ export const ServerRulesOnly = {
...Empty,
args: {
...Empty.args,
// @ts-expect-error serverRules is for test
serverRules: [
'ルール',
],
@ -85,6 +89,7 @@ export const TOSOnly = {
...Empty,
args: {
...Empty.args,
// @ts-expect-error tosUrl is for test
tosUrl: 'https://example.com/tos',
},
} satisfies StoryObj<typeof MkSignupServerRules>;
@ -92,6 +97,7 @@ export const ServerRulesAndTOS = {
...Empty,
args: {
...Empty.args,
// @ts-expect-error serverRules is for test
serverRules: ServerRulesOnly.args.serverRules,
tosUrl: TOSOnly.args.tosUrl,
},