Flutter test createUser

Created At: 2024-01-25 06:30:29 Updated At: 2024-01-25 06:30:29

Here in our TDD course we have createUser test. This section has an error and missing information in the header.

Do the following set up in the code

1 . There was no `avatar` added to the actual "createUser" call's body in the remote data source, but in the test, we were expecting that a call was made with avatar in the body, in the "verify(() => http://client.post(...));" part

2 . There was no headers in the test, but we used headers in the main code, so, there was a conflict in the verify again, also, we missed the header in the "when" stub in the test, and again, conflict

If you add header info the issue should be solved.


Add Reviews