@Maksim learn new thing we can add todo also after watching your video. One thing I noticed you wrapper fireEvent into act, but fireEvent already comes with act wrapped. if we have async things we should use waitFor(). What is your opinion for the same?
Thanks. If we have a component just for the password field which is using formik in other components. When we want to test onChange, how should we write expect if we expect the value to be something?
It would be great if you could tell me how to test useFormContext in react hook form. Every time I render the component which is having useFormContext, it throws error.
also how are you able to select the error messages just by `container.innerHtml`, to me, that's selecting the whole form, shouldn't it be selecting `helperText={errors.password && errors.password.message}` ?? thanks
When using `container.innerHtml` i'm checking the whole output. It's a legit method when you just want to make sure that some text will be rendered. It's not suitable if you want to be more specific, i.e to know that it was rendered in specific element
For production purposes it’s best to use invalid email/password to limit hackers being successful at hacking your accounts. If you give them one message it gives them the opportunity to brute force a solution
Please do video on testing react components, forms, routers , events,API , validations.
Nicely done Maksim, I hadn't see it.todo before, it's fantastic - thank you!
Yeah, it's great to be able to plan what you are going to trst
Exactly what I needed. 🙏😍
@Maksim learn new thing we can add todo also after watching your video. One thing I noticed you wrapper fireEvent into act, but fireEvent already comes with act wrapped. if we have async things we should use waitFor(). What is your opinion for the same?
Best getting started tutorial in my opinion, thank you!
niceeeeeeeeeee,, thanks to make test forms easier !!!!!😀
Have you tired this while the form is using yup? I have ugly syntax errors on jest
More React Hook Form video, react-redux or React Hook Form react component :)
this video really helped me, thanks c:
Love your content. Please do more testing tutorials!!!
what the name of the jest extension?
Thanks. If we have a component just for the password field which is using formik in other components. When we want to test onChange, how should we write expect if we expect the value to be something?
why is there `async` inside of act() function, typescript is giving me problems because there's no await
Warning: Do not await the result of calling act(...) with sync logic, it is not a Promise, yeah getting this error also
thank you! very helpful
Thanks.
Should this type of test be placed in integration tests like cypress ?
tnx,very usefule
Hi, what extension do you use for checking test directly in the editor?
Oh, you called the extension later in the video, thanks 😅
@@pavelalekseev5849 lol, yeah :-)
Thanks
If I change the mode from onBlur to onChange, the error message does not appear. How can i test the error messages for onChange mode?
Why the import "mutationobserver-shim"; ? How does that help us?
It would be great if you could tell me how to test useFormContext in react hook form. Every time I render the component which is having useFormContext, it throws error.
also how are you able to select the error messages just by `container.innerHtml`, to me, that's selecting the whole form, shouldn't it be selecting `helperText={errors.password && errors.password.message}` ?? thanks
When using `container.innerHtml` i'm checking the whole output. It's a legit method when you just want to make sure that some text will be rendered. It's not suitable if you want to be more specific, i.e to know that it was rendered in specific element
For production purposes it’s best to use invalid email/password to limit hackers being successful at hacking your accounts. If you give them one message it gives them the opportunity to brute force a solution
Marlon Johnson true, very good comment!
true but for backend endpoint responses. For browser UI not necessarily. Detailed validation on fronted is for user to know why the data is not vaid.
Why you wrapp fireEvent with email and password change into act ?
it is not needed anymore
now the fire event has act inside
@@satansdeer1 thanks!
Sorry...Not so good video to follow