aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins/video-constants.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/plugins/video-constants.ts')
-rw-r--r--server/tests/plugins/video-constants.ts37
1 files changed, 36 insertions, 1 deletions
diff --git a/server/tests/plugins/video-constants.ts b/server/tests/plugins/video-constants.ts
index eb014c596..7b1312f88 100644
--- a/server/tests/plugins/video-constants.ts
+++ b/server/tests/plugins/video-constants.ts
@@ -9,8 +9,11 @@ import {
9 getVideo, 9 getVideo,
10 getVideoCategories, 10 getVideoCategories,
11 getVideoLanguages, 11 getVideoLanguages,
12 getVideoLicences, getVideoPlaylistPrivacies, getVideoPrivacies, 12 getVideoLicences,
13 getVideoPlaylistPrivacies,
14 getVideoPrivacies,
13 installPlugin, 15 installPlugin,
16 makeGetRequest,
14 setAccessTokensToServers, 17 setAccessTokensToServers,
15 uninstallPlugin, 18 uninstallPlugin,
16 uploadVideo 19 uploadVideo
@@ -173,6 +176,38 @@ describe('Test plugin altering video constants', function () {
173 } 176 }
174 }) 177 })
175 178
179 it('Should be able to reset categories', async function () {
180 await installPlugin({
181 url: server.url,
182 accessToken: server.accessToken,
183 path: getPluginTestPath('-video-constants')
184 })
185
186 let { body: categories } = await getVideoCategories(server.url)
187
188 expect(categories[1]).to.not.exist
189 expect(categories[2]).to.not.exist
190
191 expect(categories[42]).to.exist
192 expect(categories[43]).to.exist
193
194 await makeGetRequest({
195 url: server.url,
196 token: server.accessToken,
197 path: '/plugins/test-video-constants/router/reset-categories',
198 statusCodeExpected: HttpStatusCode.NO_CONTENT_204
199 })
200
201 const { body } = await getVideoCategories(server.url)
202 categories = body
203
204 expect(categories[1]).to.exist
205 expect(categories[2]).to.exist
206
207 expect(categories[42]).to.not.exist
208 expect(categories[43]).to.not.exist
209 })
210
176 after(async function () { 211 after(async function () {
177 await cleanupTests([ server ]) 212 await cleanupTests([ server ])
178 }) 213 })