From 39aa7598b7cd0ecb0f077f50ebdd31c6e205f06d Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 2 Feb 2023 11:18:45 +0100 Subject: [PATCH] Updated tests for new login in selfservice ref #197 --- .../selfservice/selfservice_forgotten.spec.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tests/selfservice/selfservice_forgotten.spec.ts b/src/tests/selfservice/selfservice_forgotten.spec.ts index c67ef7e..9eb865e 100644 --- a/src/tests/selfservice/selfservice_forgotten.spec.ts +++ b/src/tests/selfservice/selfservice_forgotten.spec.ts @@ -15,20 +15,20 @@ beforeAll(async () => { }; }); -describe('POST /api/runners/me/forgot invalid syntax/mail should fail', () => { +describe('POST /api/runners/me/login invalid syntax/mail should fail', () => { it('get without mail return 404', async () => { - const res = await axios.post(base + '/api/runners/forgot', null, axios_config); + const res = await axios.post(base + '/api/runners/login', null, axios_config); expect(res.status).toEqual(404); expect(res.headers['content-type']).toContain("application/json"); }); it('get without bs mail return 404', async () => { - const res = await axios.post(base + '/api/runners/forgot?mail=asdasdasdasdasd@tester.test.dev.lauf-fuer-kaya.de', null, axios_config); + const res = await axios.post(base + '/api/runners/login?mail=asdasdasdasdasd@tester.test.dev.lauf-fuer-kaya.de', null, axios_config); expect(res.status).toEqual(404); expect(res.headers['content-type']).toContain("application/json"); }); }); // --------------- -describe('POST /api/runners/me/forgot 2 times within timeout should fail', () => { +describe('POST /api/runners/me/login 2 times within timeout should fail', () => { let added_runner; it('registering as citizen should return 200', async () => { const res = await axios.post(base + '/api/runners/register', { @@ -42,19 +42,19 @@ describe('POST /api/runners/me/forgot 2 times within timeout should fail', () => added_runner = res.data; }); it('post with valid mail should return 200', async () => { - const res = await axios.post(base + '/api/runners/forgot?mail=' + added_runner.email, null, axios_config); + const res = await axios.post(base + '/api/runners/login?mail=' + added_runner.email, null, axios_config); expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json"); }); it('2nd post with valid mail should return 406', async () => { - const res = await axios.post(base + '/api/runners/forgot?mail=' + added_runner.email, null, axios_config); + const res = await axios.post(base + '/api/runners/login?mail=' + added_runner.email, null, axios_config); expect(res.status).toEqual(406); expect(res.headers['content-type']).toContain("application/json"); }); }); // --------------- -describe('POST /api/runners/me/forgot valid should return 200', () => { +describe('POST /api/runners/me/login valid should return 200', () => { let added_runner; let new_token; it('registering as citizen should return 200', async () => { @@ -69,7 +69,7 @@ describe('POST /api/runners/me/forgot valid should return 200', () => { added_runner = res.data; }); it('post with valid mail should return 200', async () => { - const res = await axios.post(base + '/api/runners/forgot?mail=' + added_runner.email, null, axios_config); + const res = await axios.post(base + '/api/runners/login?mail=' + added_runner.email, null, axios_config); expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json"); new_token = res.data.token;