The POST /login endpoint currently has unit tests that cover failed scenarios (returning 400 for missing fields and 401 for incorrect credentials), but doesn’t have a positive test case.
There should be a new test that verifies that the login works when provided with the correct credentials.
Because login requires an existing user, the test should first register a user, then attempt to log in with those same credentials. The response should return 200.
The POST /login endpoint currently has unit tests that cover failed scenarios (returning 400 for missing fields and 401 for incorrect credentials), but doesn’t have a positive test case.
There should be a new test that verifies that the login works when provided with the correct credentials.
Because login requires an existing user, the test should first register a user, then attempt to log in with those same credentials. The response should return 200.