File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,23 @@ describe("Form", () => {
5858 } ) ;
5959 } ) ;
6060
61+ describe ( "Custom submit buttons" , ( ) => {
62+ it ( "should submit the form when clicked" , ( ) => {
63+ const onSubmit = sandbox . spy ( ) ;
64+ const comp = renderIntoDocument (
65+ < Form onSubmit = { onSubmit } schema = { { } } >
66+ < button type = "submit" > Submit</ button >
67+ < button type = "submit" > Another submit</ button >
68+ </ Form >
69+ ) ;
70+ const node = findDOMNode ( comp ) ;
71+ const buttons = node . querySelectorAll ( "button[type=submit]" ) ;
72+ buttons [ 0 ] . click ( ) ;
73+ buttons [ 1 ] . click ( ) ;
74+ sinon . assert . calledTwice ( onSubmit ) ;
75+ } ) ;
76+ } ) ;
77+
6178 describe ( "Custom SchemaField" , ( ) => {
6279 const CustomSchemaField = function ( props ) {
6380 return ( < div id = "custom" > < SchemaField { ...props } /> </ div > ) ;
You can’t perform that action at this time.
0 commit comments