From c86bb2adbd906f0a01f8dfcf87eaa3cacf3aa6d4 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 29 Apr 2023 15:39:25 +0200 Subject: Fixed invalid username handling --- tests/root.spec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/root.spec.js b/tests/root.spec.js index 34a8328..e422575 100644 --- a/tests/root.spec.js +++ b/tests/root.spec.js @@ -34,4 +34,17 @@ describe.concurrent('Root handlers tests', function() { }); }); }); + + describe.concurrent('With invalid credentials', function() { + it('POST /login', async function() { + await request.post('/login').send('username=NonExistant&password=Alice42!') + .expect('Content-Type', /text\/html/) + .expect(403, /erreur de connexion/); + }); + it('POST /login', async function() { + await request.post('/login').send('username=Alice&password=Invalid') + .expect('Content-Type', /text\/html/) + .expect(403, /erreur de connexion/); + }); + }); }); -- cgit v1.2.3