aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos
diff options
context:
space:
mode:
authorJosh Morel <morel.josh@hotmail.com>2019-04-02 05:26:47 -0400
committerChocobozzz <chocobozzz@cpy.re>2019-04-02 11:26:47 +0200
commit7ccddd7b5250bd25a917a6e77e58b87b9484a2a4 (patch)
treee75dc991369c1768804fefa114eb2a832881087f /server/tests/api/videos
parent12fed49ebab0c414713d57ea316b6488ae6bef99 (diff)
downloadPeerTube-7ccddd7b5250bd25a917a6e77e58b87b9484a2a4.tar.gz
PeerTube-7ccddd7b5250bd25a917a6e77e58b87b9484a2a4.tar.zst
PeerTube-7ccddd7b5250bd25a917a6e77e58b87b9484a2a4.zip
add quarantine videos feature (#1637)
* add quarantine videos feature * increase Notification settings test timeout to 20000ms. was completing 7000 locally but timing out after 10000 on travis * fix quarantine video test issues -propagate misspelling -remove skip from server/tests/client.ts * WIP use blacklist for moderator video approval instead of video.quarantine boolean * finish auto-blacklist feature
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r--server/tests/api/videos/video-blacklist.ts25
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'
23import { doubleFollow } from '../../../../shared/utils/server/follows' 24import { doubleFollow } from '../../../../shared/utils/server/follows'
24import { waitJobs } from '../../../../shared/utils/server/jobs' 25import { waitJobs } from '../../../../shared/utils/server/jobs'
25import { VideoBlacklist } from '../../../../shared/models/videos' 26import { VideoBlacklist, VideoBlacklistType } from '../../../../shared/models/videos'
26 27
27const expect = chai.expect 28const 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)