diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-06 15:22:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:17 +0200 |
commit | af971e06c620bd46a5aa64c8833364e7022b5e3d (patch) | |
tree | 4288b66b79fe4dd1ab9496e85a3abf7d747ad03a /server/tests/api/moderation | |
parent | 23a3a8827cb8b862f5cc7ee2819f39918303beca (diff) | |
download | PeerTube-af971e06c620bd46a5aa64c8833364e7022b5e3d.tar.gz PeerTube-af971e06c620bd46a5aa64c8833364e7022b5e3d.tar.zst PeerTube-af971e06c620bd46a5aa64c8833364e7022b5e3d.zip |
Introduce search command
Diffstat (limited to 'server/tests/api/moderation')
-rw-r--r-- | server/tests/api/moderation/video-blacklist.ts | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/server/tests/api/moderation/video-blacklist.ts b/server/tests/api/moderation/video-blacklist.ts index 52cac20d9..4a4930c98 100644 --- a/server/tests/api/moderation/video-blacklist.ts +++ b/server/tests/api/moderation/video-blacklist.ts | |||
@@ -7,6 +7,7 @@ import { | |||
7 | addVideoToBlacklist, | 7 | addVideoToBlacklist, |
8 | cleanupTests, | 8 | cleanupTests, |
9 | createUser, | 9 | createUser, |
10 | doubleFollow, | ||
10 | flushAndRunMultipleServers, | 11 | flushAndRunMultipleServers, |
11 | getBlacklistedVideosList, | 12 | getBlacklistedVideosList, |
12 | getMyUserInformation, | 13 | getMyUserInformation, |
@@ -15,20 +16,16 @@ import { | |||
15 | killallServers, | 16 | killallServers, |
16 | removeVideoFromBlacklist, | 17 | removeVideoFromBlacklist, |
17 | reRunServer, | 18 | reRunServer, |
18 | searchVideo, | ||
19 | ServerInfo, | 19 | ServerInfo, |
20 | setAccessTokensToServers, | 20 | setAccessTokensToServers, |
21 | updateVideo, | 21 | updateVideo, |
22 | updateVideoBlacklist, | 22 | updateVideoBlacklist, |
23 | uploadVideo, | 23 | uploadVideo, |
24 | userLogin | 24 | userLogin, |
25 | } from '../../../../shared/extra-utils/index' | 25 | waitJobs |
26 | import { doubleFollow } from '../../../../shared/extra-utils/server/follows' | 26 | } from '@shared/extra-utils' |
27 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' | 27 | import { getGoodVideoUrl, getMagnetURI, importVideo } from '@shared/extra-utils/videos/video-imports' |
28 | import { getGoodVideoUrl, getMagnetURI, importVideo } from '../../../../shared/extra-utils/videos/video-imports' | 28 | import { User, UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models' |
29 | import { User, UserRole } from '../../../../shared/models/users' | ||
30 | import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' | ||
31 | import { VideoBlacklist, VideoBlacklistType } from '../../../../shared/models/videos' | ||
32 | 29 | ||
33 | const expect = chai.expect | 30 | const expect = chai.expect |
34 | 31 | ||
@@ -80,11 +77,11 @@ describe('Test video blacklist', function () { | |||
80 | } | 77 | } |
81 | 78 | ||
82 | { | 79 | { |
83 | const res = await searchVideo(servers[0].url, 'name') | 80 | const body = await servers[0].searchCommand.searchVideos({ search: 'name' }) |
84 | 81 | ||
85 | expect(res.body.total).to.equal(0) | 82 | expect(body.total).to.equal(0) |
86 | expect(res.body.data).to.be.an('array') | 83 | expect(body.data).to.be.an('array') |
87 | expect(res.body.data.length).to.equal(0) | 84 | expect(body.data.length).to.equal(0) |
88 | } | 85 | } |
89 | }) | 86 | }) |
90 | 87 | ||
@@ -98,11 +95,11 @@ describe('Test video blacklist', function () { | |||
98 | } | 95 | } |
99 | 96 | ||
100 | { | 97 | { |
101 | const res = await searchVideo(servers[1].url, 'video') | 98 | const body = await servers[1].searchCommand.searchVideos({ search: 'name' }) |
102 | 99 | ||
103 | expect(res.body.total).to.equal(2) | 100 | expect(body.total).to.equal(2) |
104 | expect(res.body.data).to.be.an('array') | 101 | expect(body.data).to.be.an('array') |
105 | expect(res.body.data.length).to.equal(2) | 102 | expect(body.data.length).to.equal(2) |
106 | } | 103 | } |
107 | }) | 104 | }) |
108 | }) | 105 | }) |