Si algun otro le aparece el error de
[TypeError: Cannot read property ‘then’ of undefined]
Esto se puede solucionar agregando al package.json la siguiente instruccion
“jest”: {
“resetMocks”: false
},
Los mocks despues de cada prueba borrar cualquier implementacion falsa, esto quiere decir que estan fresco asi que nosotros debemos decirle a react que no haga esto, que lo mantenga como esta
–resetMocks
Automatically reset mock state before every test. Equivalent to calling jest.resetAllMocks() before each test. This will lead to any mocks having their fake implementations removed but does not restore their initial implementatio