aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r--server/tests/api/check-params/pods.ts32
1 files changed, 30 insertions, 2 deletions
diff --git a/server/tests/api/check-params/pods.ts b/server/tests/api/check-params/pods.ts
index a897e4dcd..9f9c2e4f0 100644
--- a/server/tests/api/check-params/pods.ts
+++ b/server/tests/api/check-params/pods.ts
@@ -15,7 +15,6 @@ import {
15} from '../../utils' 15} from '../../utils'
16 16
17describe('Test pods API validators', function () { 17describe('Test pods API validators', function () {
18 const path = '/api/v1/pods/'
19 let server: ServerInfo 18 let server: ServerInfo
20 19
21 // --------------------------------------------------------------- 20 // ---------------------------------------------------------------
@@ -30,6 +29,7 @@ describe('Test pods API validators', function () {
30 }) 29 })
31 30
32 describe('When managing friends', function () { 31 describe('When managing friends', function () {
32 const path = '/api/v1/pods/'
33 let userAccessToken = null 33 let userAccessToken = null
34 34
35 before(async function () { 35 before(async function () {
@@ -110,6 +110,32 @@ describe('Test pods API validators', function () {
110 }) 110 })
111 }) 111 })
112 112
113 describe('When listing friends', function () {
114 it('Should fail with a bad start pagination', async function () {
115 await request(server.url)
116 .get(path)
117 .query({ start: 'hello' })
118 .set('Accept', 'application/json')
119 .expect(400)
120 })
121
122 it('Should fail with a bad count pagination', async function () {
123 await request(server.url)
124 .get(path)
125 .query({ count: 'hello' })
126 .set('Accept', 'application/json')
127 .expect(400)
128 })
129
130 it('Should fail with an incorrect sort', async function () {
131 await request(server.url)
132 .get(path)
133 .query({ sort: 'hello' })
134 .set('Accept', 'application/json')
135 .expect(400)
136 })
137 })
138
113 describe('When quitting friends', function () { 139 describe('When quitting friends', function () {
114 it('Should fail with an invalid token', async function () { 140 it('Should fail with an invalid token', async function () {
115 await request(server.url) 141 await request(server.url)
@@ -175,7 +201,9 @@ describe('Test pods API validators', function () {
175 }) 201 })
176 }) 202 })
177 203
178 describe('When adding a pod', function () { 204 describe('When adding a pod from remote', function () {
205 const path = '/api/v1/remote/pods/add'
206
179 it('Should fail with nothing', async function () { 207 it('Should fail with nothing', async function () {
180 const fields = {} 208 const fields = {}
181 await makePostBodyRequest({ url: server.url, path, fields }) 209 await makePostBodyRequest({ url: server.url, path, fields })