From ba2684ceddf9b76312635b9cddc6bf6975ce436a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 13 Jul 2022 11:58:01 +0200 Subject: Fix lint --- server/tests/api/check-params/abuses.ts | 6 +++--- server/tests/api/check-params/live.ts | 2 +- server/tests/api/check-params/users-admin.ts | 2 +- server/tests/api/check-params/users.ts | 2 +- server/tests/api/check-params/video-blacklist.ts | 4 ++-- server/tests/api/check-params/video-imports.ts | 2 +- server/tests/api/check-params/video-playlists.ts | 2 +- server/tests/api/check-params/videos.ts | 2 +- server/tests/api/check-params/views.ts | 12 ++++++------ server/tests/api/notifications/admin-notifications.ts | 2 +- server/tests/api/notifications/notifications-api.ts | 2 +- server/tests/api/redundancy/redundancy.ts | 2 +- server/tests/api/search/search-videos.ts | 6 +++--- server/tests/api/server/handle-down.ts | 2 +- server/tests/api/videos/video-nsfw.ts | 2 +- server/tests/plugins/filter-hooks.ts | 4 ++-- server/tests/shared/notifications.ts | 2 +- 17 files changed, 28 insertions(+), 28 deletions(-) (limited to 'server/tests') 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 () { it('Should fail with a wrong video', async function () { const fields = { video: { id: 'blabla' }, reason: 'my super reason' } - await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields }) + await makePostBodyRequest({ url: server.url, path, token: userToken, fields }) }) it('Should fail with an unknown video', async function () { @@ -179,7 +179,7 @@ describe('Test abuses API validators', function () { it('Should fail with a wrong comment', async function () { const fields = { comment: { id: 'blabla' }, reason: 'my super reason' } - await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields }) + await makePostBodyRequest({ url: server.url, path, token: userToken, fields }) }) it('Should fail with an unknown comment', async function () { @@ -195,7 +195,7 @@ describe('Test abuses API validators', function () { it('Should fail with a wrong account', async function () { const fields = { account: { id: 'blabla' }, reason: 'my super reason' } - await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields }) + await makePostBodyRequest({ url: server.url, path, token: userToken, fields }) }) 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 () { const username = 'user1' const password = 'my super password' - await server.users.create({ username: username, password: password }) + await server.users.create({ username, password }) userAccessToken = await server.login.getAccessToken({ username, password }) { 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 () { await makePostBodyRequest({ url: server.url, - path: path, + path, token: server.accessToken, fields, 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 () { url: server.url, path: registrationPath, token: server.accessToken, - fields: fields, + fields, expectedStatus: HttpStatusCode.NO_CONTENT_204 }) }) 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 () { { const username = 'user1' const password = 'my super password' - await servers[0].users.create({ username: username, password: password }) + await servers[0].users.create({ username, password }) userAccessToken1 = await servers[0].login.getAccessToken({ username, password }) } { const username = 'user2' const password = 'my super password' - await servers[0].users.create({ username: username, password: password }) + await servers[0].users.create({ username, password }) userAccessToken2 = await servers[0].login.getAccessToken({ username, password }) } 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 () { const username = 'user1' const password = 'my super password' - await server.users.create({ username: username, password: password }) + await server.users.create({ username, password }) userAccessToken = await server.login.getAccessToken({ username, password }) { 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 () { } } const getUpdate = (params: any, playlistId: number | string) => { - return { ...params, playlistId: playlistId } + return { ...params, playlistId } } 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 () { support: 'my super support text', tags: [ 'tag1', 'tag2' ], privacy: VideoPrivacy.PUBLIC, - channelId: channelId, + channelId, originallyPublishedAt: new Date().toISOString() } }) 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 () { }) it('Should fail without token', async function () { - await servers[0].videoStats.getOverallStats({ videoId: videoId, token: null, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) + await servers[0].videoStats.getOverallStats({ videoId, token: null, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) }) it('Should fail with another token', async function () { await servers[0].videoStats.getOverallStats({ - videoId: videoId, + videoId, token: userAccessToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) @@ -114,7 +114,7 @@ describe('Test videos views', function () { it('Should fail without token', async function () { await servers[0].videoStats.getTimeserieStats({ - videoId: videoId, + videoId, token: null, metric: 'viewers', expectedStatus: HttpStatusCode.UNAUTHORIZED_401 @@ -123,7 +123,7 @@ describe('Test videos views', function () { it('Should fail with another token', async function () { await servers[0].videoStats.getTimeserieStats({ - videoId: videoId, + videoId, token: userAccessToken, metric: 'viewers', expectedStatus: HttpStatusCode.FORBIDDEN_403 @@ -198,7 +198,7 @@ describe('Test videos views', function () { it('Should fail without token', async function () { await servers[0].videoStats.getRetentionStats({ - videoId: videoId, + videoId, token: null, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) @@ -206,7 +206,7 @@ describe('Test videos views', function () { it('Should fail with another token', async function () { await servers[0].videoStats.getRetentionStats({ - videoId: videoId, + videoId, token: userAccessToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) 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 () { adminNotifications = res.adminNotifications baseParams = { - server: server, + server, emails, socketNotifications: adminNotifications, 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 () { before(() => { baseParams = { - server: server, + server, emails, socketNotifications: userNotifications, 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 strategies.push( { min_lifetime: '1 hour', - strategy: strategy, + strategy, size: '400KB', ...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 () { licence: 2, language: 'en' } - await server.videos.upload({ attributes: attributes }) + await server.videos.upload({ attributes }) await server.videos.upload({ attributes: { ...attributes, name: attributes.name + ' duplicate' } }) } @@ -119,7 +119,7 @@ describe('Test videos search', function () { licence: 3, language: 'pl' } - await server.videos.upload({ attributes: attributes }) + await server.videos.upload({ attributes }) } { @@ -210,7 +210,7 @@ describe('Test videos search', function () { const search = { categoryOneOf: [ 3 ] } - const body = await command.advancedVideoSearch({ search: search }) + const body = await command.advancedVideoSearch({ search }) expect(body.total).to.equal(1) 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 () { for (const state of states) { const body = await servers[0].jobs.list({ - state: state, + state, start: 0, count: 50, 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 () { it('Should create a user having the default nsfw policy', async function () { const username = 'user1' const password = 'my super password' - await server.users.create({ username: username, password: password }) + await server.users.create({ username, password }) userAccessToken = await server.login.getAccessToken({ username, password }) 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 () { const uuids: string[] = [] for (const name of [ 'bad torrent', 'bad file', 'bad playlist file' ]) { - const uuid = (await servers[0].videos.quickUpload({ name: name })).uuid + const uuid = (await servers[0].videos.quickUpload({ name })).uuid uuids.push(uuid) } @@ -446,7 +446,7 @@ describe('Test plugin filter hooks', function () { for (const name of [ 'bad embed', 'good embed' ]) { { - const uuid = (await servers[0].videos.quickUpload({ name: name })).uuid + const uuid = (await servers[0].videos.quickUpload({ name })).uuid embedVideos.push(await servers[0].videos.get({ id: uuid })) } 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 & { const check = options.check || { web: true, mail: true } if (check.web) { - const notification = await server.notifications.getLatest({ token: token }) + const notification = await server.notifications.getLatest({ token }) if (notification || checkType !== 'absence') { notificationChecker(notification, checkType) -- cgit v1.2.3