diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-07 11:51:09 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:17 +0200 |
commit | 65e6e2602c0d5521f3a6740f7469bb92830ecb53 (patch) | |
tree | f89024ffff1dafb0281ee2fe028e89b95101bd44 /server/tests/plugins/filter-hooks.ts | |
parent | bc8090411ddaa8d742ce4de3c83f9dba7bc18e2a (diff) | |
download | PeerTube-65e6e2602c0d5521f3a6740f7469bb92830ecb53.tar.gz PeerTube-65e6e2602c0d5521f3a6740f7469bb92830ecb53.tar.zst PeerTube-65e6e2602c0d5521f3a6740f7469bb92830ecb53.zip |
Introduce config command
Diffstat (limited to 'server/tests/plugins/filter-hooks.ts')
-rw-r--r-- | server/tests/plugins/filter-hooks.ts | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts index c51e96ab7..e254046bf 100644 --- a/server/tests/plugins/filter-hooks.ts +++ b/server/tests/plugins/filter-hooks.ts | |||
@@ -12,7 +12,6 @@ import { | |||
12 | doubleFollow, | 12 | doubleFollow, |
13 | flushAndRunMultipleServers, | 13 | flushAndRunMultipleServers, |
14 | getAccountVideos, | 14 | getAccountVideos, |
15 | getConfig, | ||
16 | getMyVideos, | 15 | getMyVideos, |
17 | getVideo, | 16 | getVideo, |
18 | getVideoChannelVideos, | 17 | getVideoChannelVideos, |
@@ -28,7 +27,6 @@ import { | |||
28 | ServerInfo, | 27 | ServerInfo, |
29 | setAccessTokensToServers, | 28 | setAccessTokensToServers, |
30 | setDefaultVideoChannel, | 29 | setDefaultVideoChannel, |
31 | updateCustomSubConfig, | ||
32 | updateVideo, | 30 | updateVideo, |
33 | uploadVideo, | 31 | uploadVideo, |
34 | uploadVideoAndGetId, | 32 | uploadVideoAndGetId, |
@@ -37,7 +35,6 @@ import { | |||
37 | } from '@shared/extra-utils' | 35 | } from '@shared/extra-utils' |
38 | import { getGoodVideoUrl, getMyVideoImports, importVideo } from '@shared/extra-utils/videos/video-imports' | 36 | import { getGoodVideoUrl, getMyVideoImports, importVideo } from '@shared/extra-utils/videos/video-imports' |
39 | import { | 37 | import { |
40 | ServerConfig, | ||
41 | VideoCommentThreadTree, | 38 | VideoCommentThreadTree, |
42 | VideoDetails, | 39 | VideoDetails, |
43 | VideoImport, | 40 | VideoImport, |
@@ -72,13 +69,15 @@ describe('Test plugin filter hooks', function () { | |||
72 | const res = await getVideosList(servers[0].url) | 69 | const res = await getVideosList(servers[0].url) |
73 | videoUUID = res.body.data[0].uuid | 70 | videoUUID = res.body.data[0].uuid |
74 | 71 | ||
75 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, { | 72 | await servers[0].configCommand.updateCustomSubConfig({ |
76 | live: { enabled: true }, | 73 | newConfig: { |
77 | signup: { enabled: true }, | 74 | live: { enabled: true }, |
78 | import: { | 75 | signup: { enabled: true }, |
79 | videos: { | 76 | import: { |
80 | http: { enabled: true }, | 77 | videos: { |
81 | torrent: { enabled: true } | 78 | http: { enabled: true }, |
79 | torrent: { enabled: true } | ||
80 | } | ||
82 | } | 81 | } |
83 | } | 82 | } |
84 | }) | 83 | }) |
@@ -344,8 +343,8 @@ describe('Test plugin filter hooks', function () { | |||
344 | describe('Should run filter:api.user.signup.allowed.result', function () { | 343 | describe('Should run filter:api.user.signup.allowed.result', function () { |
345 | 344 | ||
346 | it('Should run on config endpoint', async function () { | 345 | it('Should run on config endpoint', async function () { |
347 | const res = await getConfig(servers[0].url) | 346 | const body = await servers[0].configCommand.getConfig() |
348 | expect((res.body as ServerConfig).signup.allowed).to.be.true | 347 | expect(body.signup.allowed).to.be.true |
349 | }) | 348 | }) |
350 | 349 | ||
351 | it('Should allow a signup', async function () { | 350 | it('Should allow a signup', async function () { |
@@ -365,13 +364,15 @@ describe('Test plugin filter hooks', function () { | |||
365 | before(async function () { | 364 | before(async function () { |
366 | this.timeout(120000) | 365 | this.timeout(120000) |
367 | 366 | ||
368 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, { | 367 | await servers[0].configCommand.updateCustomSubConfig({ |
369 | transcoding: { | 368 | newConfig: { |
370 | webtorrent: { | 369 | transcoding: { |
371 | enabled: true | 370 | webtorrent: { |
372 | }, | 371 | enabled: true |
373 | hls: { | 372 | }, |
374 | enabled: true | 373 | hls: { |
374 | enabled: true | ||
375 | } | ||
375 | } | 376 | } |
376 | } | 377 | } |
377 | }) | 378 | }) |
@@ -427,9 +428,11 @@ describe('Test plugin filter hooks', function () { | |||
427 | before(async function () { | 428 | before(async function () { |
428 | this.timeout(60000) | 429 | this.timeout(60000) |
429 | 430 | ||
430 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, { | 431 | await servers[0].configCommand.updateCustomSubConfig({ |
431 | transcoding: { | 432 | newConfig: { |
432 | enabled: false | 433 | transcoding: { |
434 | enabled: false | ||
435 | } | ||
433 | } | 436 | } |
434 | }) | 437 | }) |
435 | 438 | ||
@@ -464,12 +467,14 @@ describe('Test plugin filter hooks', function () { | |||
464 | describe('Search filters', function () { | 467 | describe('Search filters', function () { |
465 | 468 | ||
466 | before(async function () { | 469 | before(async function () { |
467 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, { | 470 | await servers[0].configCommand.updateCustomSubConfig({ |
468 | search: { | 471 | newConfig: { |
469 | searchIndex: { | 472 | search: { |
470 | enabled: true, | 473 | searchIndex: { |
471 | isDefaultSearch: false, | 474 | enabled: true, |
472 | disableLocalSearch: false | 475 | isDefaultSearch: false, |
476 | disableLocalSearch: false | ||
477 | } | ||
473 | } | 478 | } |
474 | } | 479 | } |
475 | }) | 480 | }) |