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/abuses.ts6
-rw-r--r--server/tests/api/check-params/live.ts2
-rw-r--r--server/tests/api/check-params/users-admin.ts2
-rw-r--r--server/tests/api/check-params/users.ts2
-rw-r--r--server/tests/api/check-params/video-blacklist.ts4
-rw-r--r--server/tests/api/check-params/video-imports.ts2
-rw-r--r--server/tests/api/check-params/video-playlists.ts2
-rw-r--r--server/tests/api/check-params/videos.ts2
-rw-r--r--server/tests/api/check-params/views.ts12
9 files changed, 17 insertions, 17 deletions
diff --git a/server/tests/api/check-params/abuses.ts b/server/tests/api/check-params/abuses.ts
index bc2cc640f..7d8347412 100644
--- a/server/tests/api/check-params/abuses.ts
+++ b/server/tests/api/check-params/abuses.ts
@@ -163,7 +163,7 @@ describe('Test abuses API validators', function () {
163 163
164 it('Should fail with a wrong video', async function () { 164 it('Should fail with a wrong video', async function () {
165 const fields = { video: { id: 'blabla' }, reason: 'my super reason' } 165 const fields = { video: { id: 'blabla' }, reason: 'my super reason' }
166 await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields }) 166 await makePostBodyRequest({ url: server.url, path, token: userToken, fields })
167 }) 167 })
168 168
169 it('Should fail with an unknown video', async function () { 169 it('Should fail with an unknown video', async function () {
@@ -179,7 +179,7 @@ describe('Test abuses API validators', function () {
179 179
180 it('Should fail with a wrong comment', async function () { 180 it('Should fail with a wrong comment', async function () {
181 const fields = { comment: { id: 'blabla' }, reason: 'my super reason' } 181 const fields = { comment: { id: 'blabla' }, reason: 'my super reason' }
182 await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields }) 182 await makePostBodyRequest({ url: server.url, path, token: userToken, fields })
183 }) 183 })
184 184
185 it('Should fail with an unknown comment', async function () { 185 it('Should fail with an unknown comment', async function () {
@@ -195,7 +195,7 @@ describe('Test abuses API validators', function () {
195 195
196 it('Should fail with a wrong account', async function () { 196 it('Should fail with a wrong account', async function () {
197 const fields = { account: { id: 'blabla' }, reason: 'my super reason' } 197 const fields = { account: { id: 'blabla' }, reason: 'my super reason' }
198 await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields }) 198 await makePostBodyRequest({ url: server.url, path, token: userToken, fields })
199 }) 199 })
200 200
201 it('Should fail with an unknown account', async function () { 201 it('Should fail with an unknown account', async function () {
diff --git a/server/tests/api/check-params/live.ts b/server/tests/api/check-params/live.ts
index 29f847e51..b092f16f9 100644
--- a/server/tests/api/check-params/live.ts
+++ b/server/tests/api/check-params/live.ts
@@ -51,7 +51,7 @@ describe('Test video lives API validator', function () {
51 51
52 const username = 'user1' 52 const username = 'user1'
53 const password = 'my super password' 53 const password = 'my super password'
54 await server.users.create({ username: username, password: password }) 54 await server.users.create({ username, password })
55 userAccessToken = await server.login.getAccessToken({ username, password }) 55 userAccessToken = await server.login.getAccessToken({ username, password })
56 56
57 { 57 {
diff --git a/server/tests/api/check-params/users-admin.ts b/server/tests/api/check-params/users-admin.ts
index d8353f83b..716c22556 100644
--- a/server/tests/api/check-params/users-admin.ts
+++ b/server/tests/api/check-params/users-admin.ts
@@ -175,7 +175,7 @@ describe('Test users admin API validators', function () {
175 175
176 await makePostBodyRequest({ 176 await makePostBodyRequest({
177 url: server.url, 177 url: server.url,
178 path: path, 178 path,
179 token: server.accessToken, 179 token: server.accessToken,
180 fields, 180 fields,
181 expectedStatus: HttpStatusCode.OK_200 181 expectedStatus: HttpStatusCode.OK_200
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts
index 84254945c..4c4f54958 100644
--- a/server/tests/api/check-params/users.ts
+++ b/server/tests/api/check-params/users.ts
@@ -163,7 +163,7 @@ describe('Test users API validators', function () {
163 url: server.url, 163 url: server.url,
164 path: registrationPath, 164 path: registrationPath,
165 token: server.accessToken, 165 token: server.accessToken,
166 fields: fields, 166 fields,
167 expectedStatus: HttpStatusCode.NO_CONTENT_204 167 expectedStatus: HttpStatusCode.NO_CONTENT_204
168 }) 168 })
169 }) 169 })
diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.ts
index 1aab60826..0ec3f49d5 100644
--- a/server/tests/api/check-params/video-blacklist.ts
+++ b/server/tests/api/check-params/video-blacklist.ts
@@ -37,14 +37,14 @@ describe('Test video blacklist API validators', function () {
37 { 37 {
38 const username = 'user1' 38 const username = 'user1'
39 const password = 'my super password' 39 const password = 'my super password'
40 await servers[0].users.create({ username: username, password: password }) 40 await servers[0].users.create({ username, password })
41 userAccessToken1 = await servers[0].login.getAccessToken({ username, password }) 41 userAccessToken1 = await servers[0].login.getAccessToken({ username, password })
42 } 42 }
43 43
44 { 44 {
45 const username = 'user2' 45 const username = 'user2'
46 const password = 'my super password' 46 const password = 'my super password'
47 await servers[0].users.create({ username: username, password: password }) 47 await servers[0].users.create({ username, password })
48 userAccessToken2 = await servers[0].login.getAccessToken({ username, password }) 48 userAccessToken2 = await servers[0].login.getAccessToken({ username, password })
49 } 49 }
50 50
diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts
index da9d0826a..4439810e8 100644
--- a/server/tests/api/check-params/video-imports.ts
+++ b/server/tests/api/check-params/video-imports.ts
@@ -35,7 +35,7 @@ describe('Test video imports API validator', function () {
35 35
36 const username = 'user1' 36 const username = 'user1'
37 const password = 'my super password' 37 const password = 'my super password'
38 await server.users.create({ username: username, password: password }) 38 await server.users.create({ username, password })
39 userAccessToken = await server.login.getAccessToken({ username, password }) 39 userAccessToken = await server.login.getAccessToken({ username, password })
40 40
41 { 41 {
diff --git a/server/tests/api/check-params/video-playlists.ts b/server/tests/api/check-params/video-playlists.ts
index 4b17ce7db..8db91a3f9 100644
--- a/server/tests/api/check-params/video-playlists.ts
+++ b/server/tests/api/check-params/video-playlists.ts
@@ -209,7 +209,7 @@ describe('Test video playlists API validator', function () {
209 } 209 }
210 } 210 }
211 const getUpdate = (params: any, playlistId: number | string) => { 211 const getUpdate = (params: any, playlistId: number | string) => {
212 return { ...params, playlistId: playlistId } 212 return { ...params, playlistId }
213 } 213 }
214 214
215 it('Should fail with an unauthenticated user', async function () { 215 it('Should fail with an unauthenticated user', async function () {
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts
index 5ff51d1ff..e5c9b90c4 100644
--- a/server/tests/api/check-params/videos.ts
+++ b/server/tests/api/check-params/videos.ts
@@ -205,7 +205,7 @@ describe('Test videos API validator', function () {
205 support: 'my super support text', 205 support: 'my super support text',
206 tags: [ 'tag1', 'tag2' ], 206 tags: [ 'tag1', 'tag2' ],
207 privacy: VideoPrivacy.PUBLIC, 207 privacy: VideoPrivacy.PUBLIC,
208 channelId: channelId, 208 channelId,
209 originallyPublishedAt: new Date().toISOString() 209 originallyPublishedAt: new Date().toISOString()
210 } 210 }
211 }) 211 })
diff --git a/server/tests/api/check-params/views.ts b/server/tests/api/check-params/views.ts
index 8f1fa796b..9bf1ef6c3 100644
--- a/server/tests/api/check-params/views.ts
+++ b/server/tests/api/check-params/views.ts
@@ -64,12 +64,12 @@ describe('Test videos views', function () {
64 }) 64 })
65 65
66 it('Should fail without token', async function () { 66 it('Should fail without token', async function () {
67 await servers[0].videoStats.getOverallStats({ videoId: videoId, token: null, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) 67 await servers[0].videoStats.getOverallStats({ videoId, token: null, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
68 }) 68 })
69 69
70 it('Should fail with another token', async function () { 70 it('Should fail with another token', async function () {
71 await servers[0].videoStats.getOverallStats({ 71 await servers[0].videoStats.getOverallStats({
72 videoId: videoId, 72 videoId,
73 token: userAccessToken, 73 token: userAccessToken,
74 expectedStatus: HttpStatusCode.FORBIDDEN_403 74 expectedStatus: HttpStatusCode.FORBIDDEN_403
75 }) 75 })
@@ -114,7 +114,7 @@ describe('Test videos views', function () {
114 114
115 it('Should fail without token', async function () { 115 it('Should fail without token', async function () {
116 await servers[0].videoStats.getTimeserieStats({ 116 await servers[0].videoStats.getTimeserieStats({
117 videoId: videoId, 117 videoId,
118 token: null, 118 token: null,
119 metric: 'viewers', 119 metric: 'viewers',
120 expectedStatus: HttpStatusCode.UNAUTHORIZED_401 120 expectedStatus: HttpStatusCode.UNAUTHORIZED_401
@@ -123,7 +123,7 @@ describe('Test videos views', function () {
123 123
124 it('Should fail with another token', async function () { 124 it('Should fail with another token', async function () {
125 await servers[0].videoStats.getTimeserieStats({ 125 await servers[0].videoStats.getTimeserieStats({
126 videoId: videoId, 126 videoId,
127 token: userAccessToken, 127 token: userAccessToken,
128 metric: 'viewers', 128 metric: 'viewers',
129 expectedStatus: HttpStatusCode.FORBIDDEN_403 129 expectedStatus: HttpStatusCode.FORBIDDEN_403
@@ -198,7 +198,7 @@ describe('Test videos views', function () {
198 198
199 it('Should fail without token', async function () { 199 it('Should fail without token', async function () {
200 await servers[0].videoStats.getRetentionStats({ 200 await servers[0].videoStats.getRetentionStats({
201 videoId: videoId, 201 videoId,
202 token: null, 202 token: null,
203 expectedStatus: HttpStatusCode.UNAUTHORIZED_401 203 expectedStatus: HttpStatusCode.UNAUTHORIZED_401
204 }) 204 })
@@ -206,7 +206,7 @@ describe('Test videos views', function () {
206 206
207 it('Should fail with another token', async function () { 207 it('Should fail with another token', async function () {
208 await servers[0].videoStats.getRetentionStats({ 208 await servers[0].videoStats.getRetentionStats({
209 videoId: videoId, 209 videoId,
210 token: userAccessToken, 210 token: userAccessToken,
211 expectedStatus: HttpStatusCode.FORBIDDEN_403 211 expectedStatus: HttpStatusCode.FORBIDDEN_403
212 }) 212 })