-
Hi everyone, recently i tried testing my Form, and my submit button has attribute But the case is: the prop I using:
Details:i mocked my react-select component and the result is equal this Snippetsthe test |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Please share a codesandbox url to re-produce the issue. |
Beta Was this translation helpful? Give feedback.
-
So... someone can help me? |
Beta Was this translation helpful? Give feedback.
-
Your jest.setup.ts file for finding option value is not correct because option value is number but data from select element is string. It should be: jest.setup.ts, line 15
Furthermore, index.test.ts
|
Beta Was this translation helpful? Give feedback.
@Santosl2
Your jest.setup.ts file for finding option value is not correct because option value is number but data from select element is string. It should be:
jest.setup.ts, line 15
Furthermore,
formState.isValid
is a proxy object therefore it will be updated in next re-rendering, so a custom wait should be applied in order to get update formState value.index.test.ts