diff options
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/check-params/abuses.ts | 6 | ||||
-rw-r--r-- | server/tests/api/check-params/live.ts | 2 | ||||
-rw-r--r-- | server/tests/api/check-params/users-admin.ts | 2 | ||||
-rw-r--r-- | server/tests/api/check-params/users.ts | 2 | ||||
-rw-r--r-- | server/tests/api/check-params/video-blacklist.ts | 4 | ||||
-rw-r--r-- | server/tests/api/check-params/video-imports.ts | 2 | ||||
-rw-r--r-- | server/tests/api/check-params/video-playlists.ts | 2 | ||||
-rw-r--r-- | server/tests/api/check-params/videos.ts | 2 | ||||
-rw-r--r-- | server/tests/api/check-params/views.ts | 12 | ||||
-rw-r--r-- | server/tests/api/notifications/admin-notifications.ts | 2 | ||||
-rw-r--r-- | server/tests/api/notifications/notifications-api.ts | 2 | ||||
-rw-r--r-- | server/tests/api/redundancy/redundancy.ts | 2 | ||||
-rw-r--r-- | server/tests/api/search/search-videos.ts | 6 | ||||
-rw-r--r-- | server/tests/api/server/handle-down.ts | 2 | ||||
-rw-r--r-- | server/tests/api/videos/video-nsfw.ts | 2 | ||||
-rw-r--r-- | server/tests/plugins/filter-hooks.ts | 4 | ||||
-rw-r--r-- | server/tests/shared/notifications.ts | 2 |
17 files changed, 28 insertions, 28 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 | }) |
diff --git a/server/tests/api/notifications/admin-notifications.ts b/server/tests/api/notifications/admin-notifications.ts index f037e7aae..1501f9227 100644 --- a/server/tests/api/notifications/admin-notifications.ts +++ b/server/tests/api/notifications/admin-notifications.ts | |||
@@ -51,7 +51,7 @@ describe('Test admin notifications', function () { | |||
51 | adminNotifications = res.adminNotifications | 51 | adminNotifications = res.adminNotifications |
52 | 52 | ||
53 | baseParams = { | 53 | baseParams = { |
54 | server: server, | 54 | server, |
55 | emails, | 55 | emails, |
56 | socketNotifications: adminNotifications, | 56 | socketNotifications: adminNotifications, |
57 | token: server.accessToken | 57 | token: server.accessToken |
diff --git a/server/tests/api/notifications/notifications-api.ts b/server/tests/api/notifications/notifications-api.ts index 78864c8a0..e2b4777c0 100644 --- a/server/tests/api/notifications/notifications-api.ts +++ b/server/tests/api/notifications/notifications-api.ts | |||
@@ -99,7 +99,7 @@ describe('Test notifications API', function () { | |||
99 | 99 | ||
100 | before(() => { | 100 | before(() => { |
101 | baseParams = { | 101 | baseParams = { |
102 | server: server, | 102 | server, |
103 | emails, | 103 | emails, |
104 | socketNotifications: userNotifications, | 104 | socketNotifications: userNotifications, |
105 | token: userToken | 105 | token: userToken |
diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts index 0f7ffcb4c..9887d2535 100644 --- a/server/tests/api/redundancy/redundancy.ts +++ b/server/tests/api/redundancy/redundancy.ts | |||
@@ -53,7 +53,7 @@ async function createServers (strategy: VideoRedundancyStrategy | null, addition | |||
53 | strategies.push( | 53 | strategies.push( |
54 | { | 54 | { |
55 | min_lifetime: '1 hour', | 55 | min_lifetime: '1 hour', |
56 | strategy: strategy, | 56 | strategy, |
57 | size: '400KB', | 57 | size: '400KB', |
58 | 58 | ||
59 | ...additionalParams | 59 | ...additionalParams |
diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts index ff4c3c161..b1ebc855c 100644 --- a/server/tests/api/search/search-videos.ts +++ b/server/tests/api/search/search-videos.ts | |||
@@ -106,7 +106,7 @@ describe('Test videos search', function () { | |||
106 | licence: 2, | 106 | licence: 2, |
107 | language: 'en' | 107 | language: 'en' |
108 | } | 108 | } |
109 | await server.videos.upload({ attributes: attributes }) | 109 | await server.videos.upload({ attributes }) |
110 | 110 | ||
111 | await server.videos.upload({ attributes: { ...attributes, name: attributes.name + ' duplicate' } }) | 111 | await server.videos.upload({ attributes: { ...attributes, name: attributes.name + ' duplicate' } }) |
112 | } | 112 | } |
@@ -119,7 +119,7 @@ describe('Test videos search', function () { | |||
119 | licence: 3, | 119 | licence: 3, |
120 | language: 'pl' | 120 | language: 'pl' |
121 | } | 121 | } |
122 | await server.videos.upload({ attributes: attributes }) | 122 | await server.videos.upload({ attributes }) |
123 | } | 123 | } |
124 | 124 | ||
125 | { | 125 | { |
@@ -210,7 +210,7 @@ describe('Test videos search', function () { | |||
210 | const search = { | 210 | const search = { |
211 | categoryOneOf: [ 3 ] | 211 | categoryOneOf: [ 3 ] |
212 | } | 212 | } |
213 | const body = await command.advancedVideoSearch({ search: search }) | 213 | const body = await command.advancedVideoSearch({ search }) |
214 | 214 | ||
215 | expect(body.total).to.equal(1) | 215 | expect(body.total).to.equal(1) |
216 | 216 | ||
diff --git a/server/tests/api/server/handle-down.ts b/server/tests/api/server/handle-down.ts index 3dcd076f5..c45d3ea60 100644 --- a/server/tests/api/server/handle-down.ts +++ b/server/tests/api/server/handle-down.ts | |||
@@ -162,7 +162,7 @@ describe('Test handle downs', function () { | |||
162 | 162 | ||
163 | for (const state of states) { | 163 | for (const state of states) { |
164 | const body = await servers[0].jobs.list({ | 164 | const body = await servers[0].jobs.list({ |
165 | state: state, | 165 | state, |
166 | start: 0, | 166 | start: 0, |
167 | count: 50, | 167 | count: 50, |
168 | sort: '-createdAt' | 168 | sort: '-createdAt' |
diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.ts index 99ea67a0f..34713025d 100644 --- a/server/tests/api/videos/video-nsfw.ts +++ b/server/tests/api/videos/video-nsfw.ts | |||
@@ -136,7 +136,7 @@ describe('Test video NSFW policy', function () { | |||
136 | it('Should create a user having the default nsfw policy', async function () { | 136 | it('Should create a user having the default nsfw policy', async function () { |
137 | const username = 'user1' | 137 | const username = 'user1' |
138 | const password = 'my super password' | 138 | const password = 'my super password' |
139 | await server.users.create({ username: username, password: password }) | 139 | await server.users.create({ username, password }) |
140 | 140 | ||
141 | userAccessToken = await server.login.getAccessToken({ username, password }) | 141 | userAccessToken = await server.login.getAccessToken({ username, password }) |
142 | 142 | ||
diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts index e0f25ca26..b1f83d201 100644 --- a/server/tests/plugins/filter-hooks.ts +++ b/server/tests/plugins/filter-hooks.ts | |||
@@ -395,7 +395,7 @@ describe('Test plugin filter hooks', function () { | |||
395 | const uuids: string[] = [] | 395 | const uuids: string[] = [] |
396 | 396 | ||
397 | for (const name of [ 'bad torrent', 'bad file', 'bad playlist file' ]) { | 397 | for (const name of [ 'bad torrent', 'bad file', 'bad playlist file' ]) { |
398 | const uuid = (await servers[0].videos.quickUpload({ name: name })).uuid | 398 | const uuid = (await servers[0].videos.quickUpload({ name })).uuid |
399 | uuids.push(uuid) | 399 | uuids.push(uuid) |
400 | } | 400 | } |
401 | 401 | ||
@@ -446,7 +446,7 @@ describe('Test plugin filter hooks', function () { | |||
446 | 446 | ||
447 | for (const name of [ 'bad embed', 'good embed' ]) { | 447 | for (const name of [ 'bad embed', 'good embed' ]) { |
448 | { | 448 | { |
449 | const uuid = (await servers[0].videos.quickUpload({ name: name })).uuid | 449 | const uuid = (await servers[0].videos.quickUpload({ name })).uuid |
450 | embedVideos.push(await servers[0].videos.get({ id: uuid })) | 450 | embedVideos.push(await servers[0].videos.get({ id: uuid })) |
451 | } | 451 | } |
452 | 452 | ||
diff --git a/server/tests/shared/notifications.ts b/server/tests/shared/notifications.ts index 09bc8da03..ee15e2b09 100644 --- a/server/tests/shared/notifications.ts +++ b/server/tests/shared/notifications.ts | |||
@@ -780,7 +780,7 @@ async function checkNotification (options: CheckerBaseParams & { | |||
780 | const check = options.check || { web: true, mail: true } | 780 | const check = options.check || { web: true, mail: true } |
781 | 781 | ||
782 | if (check.web) { | 782 | if (check.web) { |
783 | const notification = await server.notifications.getLatest({ token: token }) | 783 | const notification = await server.notifications.getLatest({ token }) |
784 | 784 | ||
785 | if (notification || checkType !== 'absence') { | 785 | if (notification || checkType !== 'absence') { |
786 | notificationChecker(notification, checkType) | 786 | notificationChecker(notification, checkType) |