aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/videos-filter.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/videos-filter.ts')
-rw-r--r--server/tests/api/check-params/videos-filter.ts29
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 () {