summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJulien Dessaux2023-04-29 15:39:25 +0200
committerJulien Dessaux2023-04-29 15:39:57 +0200
commitc86bb2adbd906f0a01f8dfcf87eaa3cacf3aa6d4 (patch)
tree752b2396be946a0b75553bb3ac5feff4b40f476a /tests
parentTypo (diff)
downloadjeux-de-mots-c86bb2adbd906f0a01f8dfcf87eaa3cacf3aa6d4.tar.gz
jeux-de-mots-c86bb2adbd906f0a01f8dfcf87eaa3cacf3aa6d4.tar.bz2
jeux-de-mots-c86bb2adbd906f0a01f8dfcf87eaa3cacf3aa6d4.zip
Fixed invalid username handling
Diffstat (limited to '')
-rw-r--r--tests/root.spec.js13
1 files changed, 13 insertions, 0 deletions
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/);
+ });
+ });
});