aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/videos-filter.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/videos/videos-filter.ts')
-rw-r--r--server/tests/api/videos/videos-filter.ts20
1 files changed, 8 insertions, 12 deletions
diff --git a/server/tests/api/videos/videos-filter.ts b/server/tests/api/videos/videos-filter.ts
index 4aa00cfc4..4a5a83ee6 100644
--- a/server/tests/api/videos/videos-filter.ts
+++ b/server/tests/api/videos/videos-filter.ts
@@ -1,21 +1,17 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 5import { HttpStatusCode } from '@shared/core-utils'
6import { 6import {
7 cleanupTests, 7 cleanupTests,
8 doubleFollow, 8 doubleFollow,
9 flushAndRunMultipleServers, 9 flushAndRunMultipleServers,
10 makeGetRequest, 10 makeGetRequest,
11 ServerInfo, 11 ServerInfo,
12 setAccessTokensToServers, 12 setAccessTokensToServers
13 uploadVideo 13} from '@shared/extra-utils'
14} from '../../../../shared/extra-utils' 14import { UserRole, Video, VideoPrivacy } from '@shared/models'
15import { UserRole } from '../../../../shared/models/users'
16import { Video, VideoPrivacy } from '../../../../shared/models/videos'
17
18const expect = chai.expect
19 15
20async function getVideosNames (server: ServerInfo, token: string, filter: string, statusCodeExpected = HttpStatusCode.OK_200) { 16async function getVideosNames (server: ServerInfo, token: string, filter: string, statusCodeExpected = HttpStatusCode.OK_200) {
21 const paths = [ 17 const paths = [
@@ -62,16 +58,16 @@ describe('Test videos filter', function () {
62 await server.usersCommand.create({ username: moderator.username, password: moderator.password, role: UserRole.MODERATOR }) 58 await server.usersCommand.create({ username: moderator.username, password: moderator.password, role: UserRole.MODERATOR })
63 server['moderatorAccessToken'] = await server.loginCommand.getAccessToken(moderator) 59 server['moderatorAccessToken'] = await server.loginCommand.getAccessToken(moderator)
64 60
65 await uploadVideo(server.url, server.accessToken, { name: 'public ' + server.serverNumber }) 61 await server.videosCommand.upload({ attributes: { name: 'public ' + server.serverNumber } })
66 62
67 { 63 {
68 const attributes = { name: 'unlisted ' + server.serverNumber, privacy: VideoPrivacy.UNLISTED } 64 const attributes = { name: 'unlisted ' + server.serverNumber, privacy: VideoPrivacy.UNLISTED }
69 await uploadVideo(server.url, server.accessToken, attributes) 65 await server.videosCommand.upload({ attributes })
70 } 66 }
71 67
72 { 68 {
73 const attributes = { name: 'private ' + server.serverNumber, privacy: VideoPrivacy.PRIVATE } 69 const attributes = { name: 'private ' + server.serverNumber, privacy: VideoPrivacy.PRIVATE }
74 await uploadVideo(server.url, server.accessToken, attributes) 70 await server.videosCommand.upload({ attributes })
75 } 71 }
76 } 72 }
77 73