Skip to content

Commit c1c538b

Browse files
committed
fix: remove story with error
1 parent 7e450d3 commit c1c538b

File tree

1 file changed

+57
-57
lines changed

1 file changed

+57
-57
lines changed

src/components/forms/Form/ComplexForm.stories.tsx

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -36,43 +36,43 @@ export default {
3636
parameters: { controls: { exclude: baseProps } },
3737
};
3838

39-
const UnknownSubmitErrorTemplate: StoryFn<typeof Form> = (args) => {
40-
const [form] = Form.useForm();
41-
42-
return (
43-
<Form
44-
form={form}
45-
{...args}
46-
onSubmit={(v) => {
47-
console.log('onSubmit:', v);
48-
49-
throw new Error('Unknown error');
50-
}}
51-
onSubmitFailed={(e) => {
52-
console.log('onSubmitFailed', e);
53-
}}
54-
onValuesChange={(v) => {
55-
console.log('onChange', v);
56-
}}
57-
>
58-
<Field
59-
name="text"
60-
label="Text input"
61-
rules={[
62-
() => ({
63-
async validator() {
64-
await timeout(1000);
65-
},
66-
}),
67-
]}
68-
>
69-
<TextInput />
70-
</Field>
71-
<Submit>Submit</Submit>
72-
<SubmitError />
73-
</Form>
74-
);
75-
};
39+
// const UnknownSubmitErrorTemplate: StoryFn<typeof Form> = (args) => {
40+
// const [form] = Form.useForm();
41+
//
42+
// return (
43+
// <Form
44+
// form={form}
45+
// {...args}
46+
// onSubmit={(v) => {
47+
// console.log('onSubmit:', v);
48+
//
49+
// throw new Error('Unknown error');
50+
// }}
51+
// onSubmitFailed={(e) => {
52+
// console.log('onSubmitFailed', e);
53+
// }}
54+
// onValuesChange={(v) => {
55+
// console.log('onChange', v);
56+
// }}
57+
// >
58+
// <Field
59+
// name="text"
60+
// label="Text input"
61+
// rules={[
62+
// () => ({
63+
// async validator() {
64+
// await timeout(1000);
65+
// },
66+
// }),
67+
// ]}
68+
// >
69+
// <TextInput />
70+
// </Field>
71+
// <Submit>Submit</Submit>
72+
// <SubmitError />
73+
// </Form>
74+
// );
75+
// };
7676

7777
const CustomSubmitErrorTemplate: StoryFn<typeof Form> = (args) => {
7878
const [form] = Form.useForm();
@@ -387,23 +387,23 @@ ErrorMessage.play = CustomErrorMessage.play = async ({ canvasElement }) => {
387387
await waitFor(() => expect(canvas.getByRole('alert')).toBeInTheDocument());
388388
};
389389

390-
export const UnknownErrorMessage = UnknownSubmitErrorTemplate.bind({});
391-
392-
UnknownErrorMessage.play = async ({ canvasElement }) => {
393-
const canvas = within(canvasElement);
394-
const button = await canvas.getByRole('button');
395-
396-
await userEvent.click(button);
397-
398-
await waitFor(async () => {
399-
const alertElement = await canvas.getByText('Internal error');
400-
401-
await timeout(2000);
402-
403-
await expect(alertElement).toBeInTheDocument();
404-
405-
await userEvent.click(button);
406-
407-
expect(alertElement).not.toBeInTheDocument();
408-
});
409-
};
390+
// export const UnknownErrorMessage = UnknownSubmitErrorTemplate.bind({});
391+
//
392+
// UnknownErrorMessage.play = async ({ canvasElement }) => {
393+
// const canvas = within(canvasElement);
394+
// const button = await canvas.getByRole('button');
395+
//
396+
// await userEvent.click(button);
397+
//
398+
// await waitFor(async () => {
399+
// const alertElement = await canvas.getByText('Internal error');
400+
//
401+
// await timeout(2000);
402+
//
403+
// await expect(alertElement).toBeInTheDocument();
404+
//
405+
// await userEvent.click(button);
406+
//
407+
// expect(alertElement).not.toBeInTheDocument();
408+
// });
409+
// };

0 commit comments

Comments
 (0)