From 69796a888fa9a2f108717d320d5005db388e67b6 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Tue, 22 Dec 2020 17:04:22 +0100 Subject: [PATCH] Added wron password auth test ref #45 --- src/tests/auth/auth_login.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tests/auth/auth_login.spec.ts b/src/tests/auth/auth_login.spec.ts index dcb5d99..f0c49a9 100644 --- a/src/tests/auth/auth_login.spec.ts +++ b/src/tests/auth/auth_login.spec.ts @@ -46,4 +46,11 @@ describe('POST /api/auth/login nonexistant user', () => { const res = await axios.post(base + '/api/auth/login', { email: "test@example.com", password: "demo" }, axios_config); 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); + }); }); \ No newline at end of file