useActionState Testing
Unanswered
Cape lion posted this in #help-forum
Cape lionOP
Im really having difficult time testing any component that has useActionState hook its a greate hook but I really can't test it somehow.
the main problem is that I want to mock the action function that is being used so I can set whatever data I want, but it doesn't work at all
this is an example
I want to mock that formAction, Im using jest btw
the main problem is that I want to mock the action function that is being used so I can set whatever data I want, but it doesn't work at all
this is an example
const [formState, formAction] = useActionState(mainAction, SOME_STATE);
<form action={formAction}>
I want to mock that formAction, Im using jest btw