Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when testing component that include react-material-ui-form-validator #190

Open
FekherBr opened this issue Feb 28, 2024 · 0 comments

Comments

@FekherBr
Copy link

FekherBr commented Feb 28, 2024

react-material-ui-form-validator v3.0.1, working fine with material ui 5 /react 18, just i have a problem when running test with vitestv1.3.1/react testing library v14 in component that have the validator (removing it solves the problem)

Error:
The above error occurred in the <ForwardRef(TextField)> component:

at TextField (D:\DEV...\node_modules@mui\material\node\TextField\TextField.js:83:44)
at div
at TextValidator (D:\DEV...\node_modules\react-material-ui-form-validator\lib\TextValidator.js:38:9)
at div
at D:\DEV....\node_modules@emotion\react\dist\emotion-element-f93e57b0.cjs.dev.js:62:23
at FormControl (D:\DEV.....\node_modules@mui\material\node\FormControl\FormControl.js:92:44)
at form
at ValidatorForm (D:\DEV...\node_modules\react-form-validator-core\lib\ValidatorForm.js:57:9)
at fieldset
at AddressForm (D:\DEV......\AddressForm.tsx:19:5)
at div
at D:\DEV....\node_modules@emotion\react\dist\emotion-element-f93e57b0.cjs.dev.js:62:23
at Box (D:\DEV....\node_modules@mui\system\createBox.js:31:41)
at div
at D:\DEV.....\node_modules@emotion\react\dist\emotion-element-f93e57b0.cjs.dev.js:62:23
at Box (D:\DEV....\node_modules@mui\system\createBox.js:31:41)
at Address (D:\DEV....\Address.tsx:81:11)

implementation

<TextValidator
label="a"
onChange={onValChange}
name="a"
value={val}
validators={["required"]}
errorMessages={["This field is required"]}
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant