Added wron password auth test

ref #45
This commit is contained in:
Nicolai Ort 2020-12-22 17:04:22 +01:00
parent af2744885f
commit 69796a888f

View File

@ -47,3 +47,10 @@ describe('POST /api/auth/login nonexistant user', () => {
expect(res.status).toEqual(404); expect(res.status).toEqual(404);
}); });
}); });
// ---------------
describe('POST /api/auth/login wrong password', () => {
it('login with wrong password should return 401', async () => {
const res = await axios.post(base + '/api/auth/login', { username: "demo", password: "totallynotthecorrectpassword" }, axios_config);
expect(res.status).toEqual(401);
});
});