diff options
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r-- | server/tests/api/videos/video-blacklist.ts | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/server/tests/api/videos/video-blacklist.ts b/server/tests/api/videos/video-blacklist.ts index d39ad63b4..10b412a80 100644 --- a/server/tests/api/videos/video-blacklist.ts +++ b/server/tests/api/videos/video-blacklist.ts | |||
@@ -7,6 +7,7 @@ import { | |||
7 | addVideoToBlacklist, | 7 | addVideoToBlacklist, |
8 | flushAndRunMultipleServers, | 8 | flushAndRunMultipleServers, |
9 | getBlacklistedVideosList, | 9 | getBlacklistedVideosList, |
10 | getBlacklistedVideosListWithTypeFilter, | ||
10 | getMyVideos, | 11 | getMyVideos, |
11 | getSortedBlacklistedVideosList, | 12 | getSortedBlacklistedVideosList, |
12 | getVideosList, | 13 | getVideosList, |
@@ -22,7 +23,7 @@ import { | |||
22 | } from '../../../../shared/utils/index' | 23 | } from '../../../../shared/utils/index' |
23 | import { doubleFollow } from '../../../../shared/utils/server/follows' | 24 | import { doubleFollow } from '../../../../shared/utils/server/follows' |
24 | import { waitJobs } from '../../../../shared/utils/server/jobs' | 25 | import { waitJobs } from '../../../../shared/utils/server/jobs' |
25 | import { VideoBlacklist } from '../../../../shared/models/videos' | 26 | import { VideoBlacklist, VideoBlacklistType } from '../../../../shared/models/videos' |
26 | 27 | ||
27 | const expect = chai.expect | 28 | const expect = chai.expect |
28 | 29 | ||
@@ -101,7 +102,7 @@ describe('Test video blacklist management', function () { | |||
101 | }) | 102 | }) |
102 | }) | 103 | }) |
103 | 104 | ||
104 | describe('When listing blacklisted videos', function () { | 105 | describe('When listing manually blacklisted videos', function () { |
105 | it('Should display all the blacklisted videos', async function () { | 106 | it('Should display all the blacklisted videos', async function () { |
106 | const res = await getBlacklistedVideosList(servers[0].url, servers[0].accessToken) | 107 | const res = await getBlacklistedVideosList(servers[0].url, servers[0].accessToken) |
107 | 108 | ||
@@ -117,6 +118,26 @@ describe('Test video blacklist management', function () { | |||
117 | } | 118 | } |
118 | }) | 119 | }) |
119 | 120 | ||
121 | it('Should display all the blacklisted videos when applying manual type filter', async function () { | ||
122 | const res = await getBlacklistedVideosListWithTypeFilter(servers[0].url, servers[0].accessToken, VideoBlacklistType.MANUAL) | ||
123 | |||
124 | expect(res.body.total).to.equal(2) | ||
125 | |||
126 | const blacklistedVideos = res.body.data | ||
127 | expect(blacklistedVideos).to.be.an('array') | ||
128 | expect(blacklistedVideos.length).to.equal(2) | ||
129 | }) | ||
130 | |||
131 | it('Should display nothing when applying automatic type filter', async function () { | ||
132 | const res = await getBlacklistedVideosListWithTypeFilter(servers[0].url, servers[0].accessToken, VideoBlacklistType.AUTO_BEFORE_PUBLISHED) // tslint:disable:max-line-length | ||
133 | |||
134 | expect(res.body.total).to.equal(0) | ||
135 | |||
136 | const blacklistedVideos = res.body.data | ||
137 | expect(blacklistedVideos).to.be.an('array') | ||
138 | expect(blacklistedVideos.length).to.equal(0) | ||
139 | }) | ||
140 | |||
120 | it('Should get the correct sort when sorting by descending id', async function () { | 141 | it('Should get the correct sort when sorting by descending id', async function () { |
121 | const res = await getSortedBlacklistedVideosList(servers[0].url, servers[0].accessToken, '-id') | 142 | const res = await getSortedBlacklistedVideosList(servers[0].url, servers[0].accessToken, '-id') |
122 | expect(res.body.total).to.equal(2) | 143 | expect(res.body.total).to.equal(2) |