@@ -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
7777const CustomSubmitErrorTemplate : StoryFn < typeof Form > = ( args ) => {
7878 const [ form ] = Form . useForm ( ) ;
@@ -387,8 +387,8 @@ ErrorMessage.play = CustomErrorMessage.play = async ({ canvasElement }) => {
387387 await waitFor ( ( ) => expect ( canvas . getByRole ( 'alert' ) ) . toBeInTheDocument ( ) ) ;
388388} ;
389389
390- export const UnknownErrorMessage = UnknownSubmitErrorTemplate . bind ( { } ) ;
391-
390+ // export const UnknownErrorMessage = UnknownSubmitErrorTemplate.bind({});
391+ //
392392// UnknownErrorMessage.play = async ({ canvasElement }) => {
393393// const canvas = within(canvasElement);
394394// const button = await canvas.getByRole('button');
0 commit comments