diff options
Diffstat (limited to 'server/tests/api/video-blacklist.ts')
-rw-r--r-- | server/tests/api/video-blacklist.ts | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/server/tests/api/video-blacklist.ts b/server/tests/api/video-blacklist.ts index e789611d0..235fdd7af 100644 --- a/server/tests/api/video-blacklist.ts +++ b/server/tests/api/video-blacklist.ts | |||
@@ -1,22 +1,22 @@ | |||
1 | /* tslint:disable:no-unused-expression */ | 1 | /* tslint:disable:no-unused-expression */ |
2 | 2 | ||
3 | import 'mocha' | ||
4 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
5 | const expect = chai.expect | 4 | import 'mocha' |
6 | |||
7 | import { | 5 | import { |
8 | ServerInfo, | 6 | addVideoToBlacklist, |
7 | flushAndRunMultipleServers, | ||
9 | flushTests, | 8 | flushTests, |
10 | uploadVideo, | ||
11 | makeFriends, | ||
12 | getVideosList, | 9 | getVideosList, |
13 | wait, | 10 | killallServers, |
14 | setAccessTokensToServers, | ||
15 | flushAndRunMultipleServers, | ||
16 | addVideoToBlacklist, | ||
17 | searchVideo, | 11 | searchVideo, |
18 | killallServers | 12 | ServerInfo, |
13 | setAccessTokensToServers, | ||
14 | uploadVideo, | ||
15 | wait | ||
19 | } from '../utils' | 16 | } from '../utils' |
17 | import { doubleFollow } from '../utils/follows' | ||
18 | |||
19 | const expect = chai.expect | ||
20 | 20 | ||
21 | describe('Test video blacklists', function () { | 21 | describe('Test video blacklists', function () { |
22 | let servers: ServerInfo[] = [] | 22 | let servers: ServerInfo[] = [] |
@@ -30,32 +30,32 @@ describe('Test video blacklists', function () { | |||
30 | // Get the access tokens | 30 | // Get the access tokens |
31 | await setAccessTokensToServers(servers) | 31 | await setAccessTokensToServers(servers) |
32 | 32 | ||
33 | // Pod 1 makes friend with pod 2 | 33 | // Server 1 and server 2 follow each other |
34 | await makeFriends(servers[0].url, servers[0].accessToken) | 34 | await doubleFollow(servers[0], servers[1]) |
35 | 35 | ||
36 | // Upload a video on pod 2 | 36 | // Upload a video on server 2 |
37 | const videoAttributes = { | 37 | const videoAttributes = { |
38 | name: 'my super name for pod 2', | 38 | name: 'my super name for server 2', |
39 | description: 'my super description for pod 2' | 39 | description: 'my super description for server 2' |
40 | } | 40 | } |
41 | await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes) | 41 | await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes) |
42 | 42 | ||
43 | // Wait videos propagation | 43 | // Wait videos propagation |
44 | await wait(22000) | 44 | await wait(25000) |
45 | 45 | ||
46 | const res = await getVideosList(servers[0].url) | 46 | const res = await getVideosList(servers[0].url) |
47 | const videos = res.body.data | 47 | const videos = res.body.data |
48 | 48 | ||
49 | expect(videos.length).to.equal(1) | 49 | expect(videos.length).to.equal(1) |
50 | 50 | ||
51 | servers[0].remoteVideo = videos.find(video => video.name === 'my super name for pod 2') | 51 | servers[0].remoteVideo = videos.find(video => video.name === 'my super name for server 2') |
52 | }) | 52 | }) |
53 | 53 | ||
54 | it('Should blacklist a remote video on pod 1', async function () { | 54 | it('Should blacklist a remote video on server 1', async function () { |
55 | await addVideoToBlacklist(servers[0].url, servers[0].accessToken, servers[0].remoteVideo.id) | 55 | await addVideoToBlacklist(servers[0].url, servers[0].accessToken, servers[0].remoteVideo.id) |
56 | }) | 56 | }) |
57 | 57 | ||
58 | it('Should not have the video blacklisted in videos list on pod 1', async function () { | 58 | it('Should not have the video blacklisted in videos list on server 1', async function () { |
59 | const res = await getVideosList(servers[0].url) | 59 | const res = await getVideosList(servers[0].url) |
60 | 60 | ||
61 | expect(res.body.total).to.equal(0) | 61 | expect(res.body.total).to.equal(0) |
@@ -63,7 +63,7 @@ describe('Test video blacklists', function () { | |||
63 | expect(res.body.data.length).to.equal(0) | 63 | expect(res.body.data.length).to.equal(0) |
64 | }) | 64 | }) |
65 | 65 | ||
66 | it('Should not have the video blacklisted in videos search on pod 1', async function () { | 66 | it('Should not have the video blacklisted in videos search on server 1', async function () { |
67 | const res = await searchVideo(servers[0].url, 'name') | 67 | const res = await searchVideo(servers[0].url, 'name') |
68 | 68 | ||
69 | expect(res.body.total).to.equal(0) | 69 | expect(res.body.total).to.equal(0) |
@@ -71,7 +71,7 @@ describe('Test video blacklists', function () { | |||
71 | expect(res.body.data.length).to.equal(0) | 71 | expect(res.body.data.length).to.equal(0) |
72 | }) | 72 | }) |
73 | 73 | ||
74 | it('Should have the blacklisted video in videos list on pod 2', async function () { | 74 | it('Should have the blacklisted video in videos list on server 2', async function () { |
75 | const res = await getVideosList(servers[1].url) | 75 | const res = await getVideosList(servers[1].url) |
76 | 76 | ||
77 | expect(res.body.total).to.equal(1) | 77 | expect(res.body.total).to.equal(1) |
@@ -79,7 +79,7 @@ describe('Test video blacklists', function () { | |||
79 | expect(res.body.data.length).to.equal(1) | 79 | expect(res.body.data.length).to.equal(1) |
80 | }) | 80 | }) |
81 | 81 | ||
82 | it('Should have the video blacklisted in videos search on pod 2', async function () { | 82 | it('Should have the video blacklisted in videos search on server 2', async function () { |
83 | const res = await searchVideo(servers[1].url, 'name') | 83 | const res = await searchVideo(servers[1].url, 'name') |
84 | 84 | ||
85 | expect(res.body.total).to.equal(1) | 85 | expect(res.body.total).to.equal(1) |