@@ -820,7 +820,7 @@ describe('createFormHook', () => {
820820 const Component5 = < FieldGroup form = { form } fields = "nope2" />
821821 } )
822822
823- it ( 'should allow interfaces without index signatures to be assigned to `props` in withForm' , ( ) => {
823+ it ( 'should allow interfaces without index signatures to be assigned to `props` in withForm and withFormGroup ' , ( ) => {
824824 interface TestNoSignature {
825825 title : string
826826 }
@@ -842,20 +842,55 @@ describe('createFormHook', () => {
842842 render : ( ) => < > </ > ,
843843 } )
844844
845+ const WithFieldGroupComponent1 = withFieldGroup ( {
846+ defaultValues : { name : '' } ,
847+ props : { } as TestNoSignature ,
848+ render : ( ) => < > </ > ,
849+ } )
850+
851+ const WithFieldGroupComponent2 = withFieldGroup ( {
852+ defaultValues : { name : '' } ,
853+ props : { } as TestWithSignature ,
854+ render : ( ) => < > </ > ,
855+ } )
856+
845857 const appForm = useAppForm ( { defaultValues : { name : '' } } )
846858
847859 const Component1 = < WithFormComponent1 title = "" form = { appForm } />
848860 const Component2 = (
849861 < WithFormComponent2 title = "" something = "else" form = { appForm } />
850862 )
863+
864+ const FieldGroupComponent1 = (
865+ < WithFieldGroupComponent1
866+ title = ""
867+ form = { appForm }
868+ fields = { { name : 'name' } }
869+ />
870+ )
871+ const FieldGroupComponent2 = (
872+ < WithFieldGroupComponent2
873+ title = ""
874+ something = "else"
875+ form = { appForm }
876+ fields = { { name : 'name' } }
877+ />
878+ )
851879 } )
852880
853- it ( 'should not allow null as prop in withForm' , ( ) => {
881+ it ( 'should not allow null as prop in withForm and withFormGroup ' , ( ) => {
854882 const WithFormComponent = withForm ( {
855883 defaultValues : { name : '' } ,
856884 // @ts -expect-error
857885 props : null ,
858886 render : ( ) => < > </ > ,
859887 } )
860888 } )
889+
890+ const WithFieldGroupComponent = withFieldGroup ( {
891+ defaultValues : { name : '' } ,
892+ // @ts -expect-error
893+ props : null ,
894+ render : ( ) => < > </ > ,
895+ } )
861896} )
0 commit comments