File tree Expand file tree Collapse file tree 1 file changed +22
-8
lines changed Expand file tree Collapse file tree 1 file changed +22
-8
lines changed Original file line number Diff line number Diff line change 1- import React from "react" ;
2- import { render } from "@testing-library/react" ;
3- import { FormProps } from "@rjsf/utils" ;
4- import validator from "@rjsf/validator-ajv8" ;
1+ import { render } from '@testing-library/react' ;
2+ import { FormProps , RJSFSchema } from '@rjsf/utils' ;
3+ import validator from '@rjsf/validator-ajv8' ;
54
6- import Theme from " ../src/Theme" ; // Import the USWDS theme
7- import Form from " ../src/Form" ; // Import the USWDS Form
5+ import Theme from ' ../src/Theme' ;
6+ import Form from ' ../src/Form' ;
87
98export function createFormComponent < T = any > ( props : FormProps < T > ) {
10- return render ( < Form validator = { validator } { ...props } theme = { Theme } /> ) ;
9+ const { schema, uiSchema, formData, ...rest } = props ;
10+ return render (
11+ < Form
12+ schema = { schema }
13+ uiSchema = { uiSchema }
14+ formData = { formData }
15+ validator = { validator }
16+ theme = { Theme } // Pass the theme explicitly if needed
17+ { ...rest }
18+ /> ,
19+ ) ;
1120}
1221
13- // You can add other common test utilities here if needed
22+ export function createSandbox ( ) {
23+ const schema : RJSFSchema = {
24+ type : 'string' ,
25+ } ;
26+ return createFormComponent ( { schema } ) ;
27+ }
You can’t perform that action at this time.
0 commit comments