aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params.js')
-rw-r--r--server/tests/api/check-params.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/tests/api/check-params.js b/server/tests/api/check-params.js
index 57b5ca024..07f41daab 100644
--- a/server/tests/api/check-params.js
+++ b/server/tests/api/check-params.js
@@ -497,6 +497,7 @@ describe('Test parameters validator', function () {
497 describe('Of the users API', function () { 497 describe('Of the users API', function () {
498 const path = '/api/v1/users/' 498 const path = '/api/v1/users/'
499 let userId = null 499 let userId = null
500 let rootId = null
500 501
501 describe('When listing users', function () { 502 describe('When listing users', function () {
502 it('Should fail with a bad start pagination', function (done) { 503 it('Should fail with a bad start pagination', function (done) {
@@ -626,6 +627,7 @@ describe('Test parameters validator', function () {
626 if (err) throw err 627 if (err) throw err
627 628
628 userId = res.body.data[1].id 629 userId = res.body.data[1].id
630 rootId = res.body.data[2].id
629 done() 631 done()
630 }) 632 })
631 }) 633 })
@@ -691,6 +693,13 @@ describe('Test parameters validator', function () {
691 .expect(400, done) 693 .expect(400, done)
692 }) 694 })
693 695
696 it('Should fail with the root user', function (done) {
697 request(server.url)
698 .delete(path + rootId)
699 .set('Authorization', 'Bearer ' + server.accessToken)
700 .expect(400, done)
701 })
702
694 it('Should return 404 with a non existing id', function (done) { 703 it('Should return 404 with a non existing id', function (done) {
695 request(server.url) 704 request(server.url)
696 .delete(path + '579f982228c99c221d8092b8') 705 .delete(path + '579f982228c99c221d8092b8')