diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-21 15:45:42 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-21 15:45:42 +0200 |
commit | 5f26f13b3c16ac5ae0a3b0a7142d84a9528cf565 (patch) | |
tree | 64021f952b125ae3d152c07180804fd13adfeb48 /server/tests/plugins/video-constants.ts | |
parent | 435990290a61ca6fdb679e6b076ef9157b89a6ce (diff) | |
parent | 2b9f672b58bc2c13c96ee79f522003979e4bfc02 (diff) | |
download | PeerTube-5f26f13b3c16ac5ae0a3b0a7142d84a9528cf565.tar.gz PeerTube-5f26f13b3c16ac5ae0a3b0a7142d84a9528cf565.tar.zst PeerTube-5f26f13b3c16ac5ae0a3b0a7142d84a9528cf565.zip |
Merge branch 'constant-registry' into develop
Diffstat (limited to 'server/tests/plugins/video-constants.ts')
-rw-r--r-- | server/tests/plugins/video-constants.ts | 37 |
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 | }) |