aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/user-subscriptions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/user-subscriptions.ts')
-rw-r--r--server/tests/api/check-params/user-subscriptions.ts27
1 files changed, 13 insertions, 14 deletions
diff --git a/server/tests/api/check-params/user-subscriptions.ts b/server/tests/api/check-params/user-subscriptions.ts
index 1fe67fa7c..fa36c4078 100644
--- a/server/tests/api/check-params/user-subscriptions.ts
+++ b/server/tests/api/check-params/user-subscriptions.ts
@@ -3,13 +3,12 @@
3import 'mocha' 3import 'mocha'
4 4
5import { 5import {
6 cleanupTests,
6 createUser, 7 createUser,
7 flushTests, 8 flushAndRunServer,
8 killallServers,
9 makeDeleteRequest, 9 makeDeleteRequest,
10 makeGetRequest, 10 makeGetRequest,
11 makePostBodyRequest, 11 makePostBodyRequest,
12 flushAndRunServer,
13 ServerInfo, 12 ServerInfo,
14 setAccessTokensToServers, 13 setAccessTokensToServers,
15 userLogin 14 userLogin
@@ -113,7 +112,7 @@ describe('Test user subscriptions API validators', function () {
113 await makePostBodyRequest({ 112 await makePostBodyRequest({
114 url: server.url, 113 url: server.url,
115 path, 114 path,
116 fields: { uri: 'user1_channel@localhost:9001' }, 115 fields: { uri: 'user1_channel@localhost:' + server.port },
117 statusCodeExpected: 401 116 statusCodeExpected: 401
118 }) 117 })
119 }) 118 })
@@ -151,7 +150,7 @@ describe('Test user subscriptions API validators', function () {
151 url: server.url, 150 url: server.url,
152 path, 151 path,
153 token: server.accessToken, 152 token: server.accessToken,
154 fields: { uri: 'user1_channel@localhost:9001' }, 153 fields: { uri: 'user1_channel@localhost:' + server.port },
155 statusCodeExpected: 204 154 statusCodeExpected: 204
156 }) 155 })
157 156
@@ -163,7 +162,7 @@ describe('Test user subscriptions API validators', function () {
163 it('Should fail with a non authenticated user', async function () { 162 it('Should fail with a non authenticated user', async function () {
164 await makeGetRequest({ 163 await makeGetRequest({
165 url: server.url, 164 url: server.url,
166 path: path + '/user1_channel@localhost:9001', 165 path: path + '/user1_channel@localhost:' + server.port,
167 statusCodeExpected: 401 166 statusCodeExpected: 401
168 }) 167 })
169 }) 168 })
@@ -194,7 +193,7 @@ describe('Test user subscriptions API validators', function () {
194 it('Should fail with an unknown subscription', async function () { 193 it('Should fail with an unknown subscription', async function () {
195 await makeGetRequest({ 194 await makeGetRequest({
196 url: server.url, 195 url: server.url,
197 path: path + '/root1@localhost:9001', 196 path: path + '/root1@localhost:' + server.port,
198 token: server.accessToken, 197 token: server.accessToken,
199 statusCodeExpected: 404 198 statusCodeExpected: 404
200 }) 199 })
@@ -203,7 +202,7 @@ describe('Test user subscriptions API validators', function () {
203 it('Should succeed with the correct parameters', async function () { 202 it('Should succeed with the correct parameters', async function () {
204 await makeGetRequest({ 203 await makeGetRequest({
205 url: server.url, 204 url: server.url,
206 path: path + '/user1_channel@localhost:9001', 205 path: path + '/user1_channel@localhost:' + server.port,
207 token: server.accessToken, 206 token: server.accessToken,
208 statusCodeExpected: 200 207 statusCodeExpected: 200
209 }) 208 })
@@ -243,7 +242,7 @@ describe('Test user subscriptions API validators', function () {
243 await makeGetRequest({ 242 await makeGetRequest({
244 url: server.url, 243 url: server.url,
245 path: existPath, 244 path: existPath,
246 query: { 'uris[]': 'coucou@localhost:9001' }, 245 query: { 'uris[]': 'coucou@localhost:' + server.port },
247 token: server.accessToken, 246 token: server.accessToken,
248 statusCodeExpected: 200 247 statusCodeExpected: 200
249 }) 248 })
@@ -254,7 +253,7 @@ describe('Test user subscriptions API validators', function () {
254 it('Should fail with a non authenticated user', async function () { 253 it('Should fail with a non authenticated user', async function () {
255 await makeDeleteRequest({ 254 await makeDeleteRequest({
256 url: server.url, 255 url: server.url,
257 path: path + '/user1_channel@localhost:9001', 256 path: path + '/user1_channel@localhost:' + server.port,
258 statusCodeExpected: 401 257 statusCodeExpected: 401
259 }) 258 })
260 }) 259 })
@@ -285,7 +284,7 @@ describe('Test user subscriptions API validators', function () {
285 it('Should fail with an unknown subscription', async function () { 284 it('Should fail with an unknown subscription', async function () {
286 await makeDeleteRequest({ 285 await makeDeleteRequest({
287 url: server.url, 286 url: server.url,
288 path: path + '/root1@localhost:9001', 287 path: path + '/root1@localhost:' + server.port,
289 token: server.accessToken, 288 token: server.accessToken,
290 statusCodeExpected: 404 289 statusCodeExpected: 404
291 }) 290 })
@@ -294,14 +293,14 @@ describe('Test user subscriptions API validators', function () {
294 it('Should succeed with the correct parameters', async function () { 293 it('Should succeed with the correct parameters', async function () {
295 await makeDeleteRequest({ 294 await makeDeleteRequest({
296 url: server.url, 295 url: server.url,
297 path: path + '/user1_channel@localhost:9001', 296 path: path + '/user1_channel@localhost:' + server.port,
298 token: server.accessToken, 297 token: server.accessToken,
299 statusCodeExpected: 204 298 statusCodeExpected: 204
300 }) 299 })
301 }) 300 })
302 }) 301 })
303 302
304 after(function () { 303 after(async function () {
305 killallServers([ server ]) 304 await cleanupTests([ server ])
306 }) 305 })
307}) 306})