diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-18 15:29:38 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-18 15:29:38 +0100 |
commit | 0aa52e170727ac6bdf441bcaa2353ae0b8a354ed (patch) | |
tree | 52fa047cf9970590cab1dcc7a3e5caa8eb004171 /server/tests/api/check-params | |
parent | ff2cac9fa361a3c5489078f441ed54230c045971 (diff) | |
download | PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.tar.gz PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.tar.zst PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.zip |
Add ability to display all channel/account videos
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r-- | server/tests/api/check-params/videos-filter.ts | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/server/tests/api/check-params/videos-filter.ts b/server/tests/api/check-params/videos-filter.ts index ec8654db2..bf8248b0e 100644 --- a/server/tests/api/check-params/videos-filter.ts +++ b/server/tests/api/check-params/videos-filter.ts | |||
@@ -78,28 +78,33 @@ describe('Test videos filters', function () { | |||
78 | await testEndpoints(server, server.accessToken, 'local', 200) | 78 | await testEndpoints(server, server.accessToken, 'local', 200) |
79 | }) | 79 | }) |
80 | 80 | ||
81 | it('Should fail to list all-local with a simple user', async function () { | 81 | it('Should fail to list all-local/all with a simple user', async function () { |
82 | await testEndpoints(server, userAccessToken, 'all-local', 401) | 82 | await testEndpoints(server, userAccessToken, 'all-local', 401) |
83 | await testEndpoints(server, userAccessToken, 'all', 401) | ||
83 | }) | 84 | }) |
84 | 85 | ||
85 | it('Should succeed to list all-local with a moderator', async function () { | 86 | it('Should succeed to list all-local/all with a moderator', async function () { |
86 | await testEndpoints(server, moderatorAccessToken, 'all-local', 200) | 87 | await testEndpoints(server, moderatorAccessToken, 'all-local', 200) |
88 | await testEndpoints(server, moderatorAccessToken, 'all', 200) | ||
87 | }) | 89 | }) |
88 | 90 | ||
89 | it('Should succeed to list all-local with an admin', async function () { | 91 | it('Should succeed to list all-local/all with an admin', async function () { |
90 | await testEndpoints(server, server.accessToken, 'all-local', 200) | 92 | await testEndpoints(server, server.accessToken, 'all-local', 200) |
93 | await testEndpoints(server, server.accessToken, 'all', 200) | ||
91 | }) | 94 | }) |
92 | 95 | ||
93 | // Because we cannot authenticate the user on the RSS endpoint | 96 | // Because we cannot authenticate the user on the RSS endpoint |
94 | it('Should fail on the feeds endpoint with the all-local filter', async function () { | 97 | it('Should fail on the feeds endpoint with the all-local/all filter', async function () { |
95 | await makeGetRequest({ | 98 | for (const filter of [ 'all', 'all-local' ]) { |
96 | url: server.url, | 99 | await makeGetRequest({ |
97 | path: '/feeds/videos.json', | 100 | url: server.url, |
98 | statusCodeExpected: 401, | 101 | path: '/feeds/videos.json', |
99 | query: { | 102 | statusCodeExpected: 401, |
100 | filter: 'all-local' | 103 | query: { |
101 | } | 104 | filter |
102 | }) | 105 | } |
106 | }) | ||
107 | } | ||
103 | }) | 108 | }) |
104 | 109 | ||
105 | it('Should succeed on the feeds endpoint with the local filter', async function () { | 110 | it('Should succeed on the feeds endpoint with the local filter', async function () { |