diff options
Diffstat (limited to 'server/tests/api/check-params/user-subscriptions.ts')
-rw-r--r-- | server/tests/api/check-params/user-subscriptions.ts | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/server/tests/api/check-params/user-subscriptions.ts b/server/tests/api/check-params/user-subscriptions.ts index 6a6dd9a6f..9fba99ac8 100644 --- a/server/tests/api/check-params/user-subscriptions.ts +++ b/server/tests/api/check-params/user-subscriptions.ts | |||
@@ -202,6 +202,46 @@ describe('Test user subscriptions API validators', function () { | |||
202 | }) | 202 | }) |
203 | }) | 203 | }) |
204 | 204 | ||
205 | describe('When checking if subscriptions exist', async function () { | ||
206 | const existPath = path + '/exist' | ||
207 | |||
208 | it('Should fail with a non authenticated user', async function () { | ||
209 | await makeGetRequest({ | ||
210 | url: server.url, | ||
211 | path: existPath, | ||
212 | statusCodeExpected: 401 | ||
213 | }) | ||
214 | }) | ||
215 | |||
216 | it('Should fail with bad URIs', async function () { | ||
217 | await makeGetRequest({ | ||
218 | url: server.url, | ||
219 | path: existPath, | ||
220 | query: { uris: 'toto' }, | ||
221 | token: server.accessToken, | ||
222 | statusCodeExpected: 400 | ||
223 | }) | ||
224 | |||
225 | await makeGetRequest({ | ||
226 | url: server.url, | ||
227 | path: existPath, | ||
228 | query: { 'uris[]': 1 }, | ||
229 | token: server.accessToken, | ||
230 | statusCodeExpected: 400 | ||
231 | }) | ||
232 | }) | ||
233 | |||
234 | it('Should succeed with the correct parameters', async function () { | ||
235 | await makeGetRequest({ | ||
236 | url: server.url, | ||
237 | path: existPath, | ||
238 | query: { 'uris[]': 'coucou@localhost:9001' }, | ||
239 | token: server.accessToken, | ||
240 | statusCodeExpected: 200 | ||
241 | }) | ||
242 | }) | ||
243 | }) | ||
244 | |||
205 | describe('When removing a subscription', function () { | 245 | describe('When removing a subscription', function () { |
206 | it('Should fail with a non authenticated user', async function () { | 246 | it('Should fail with a non authenticated user', async function () { |
207 | await makeDeleteRequest({ | 247 | await makeDeleteRequest({ |