summaryrefslogtreecommitdiff
path: root/tests/root.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/root.spec.js')
-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/);
+ });
+ });
});