diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-17 16:02:38 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-06-25 14:44:01 +0200 |
commit | 37a44fc915eef2140e22ceb96aba6b6eb2509007 (patch) | |
tree | dd4a370ecc96cf38c99b940261aadc27065da7ae /server/tests/plugins | |
parent | 33eb19e5199cc9fa4d73c6675c97508e3e072ef9 (diff) | |
download | PeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.tar.gz PeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.tar.zst PeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.zip |
Add ability to search playlists
Diffstat (limited to 'server/tests/plugins')
-rw-r--r-- | server/tests/plugins/filter-hooks.ts | 24 | ||||
-rw-r--r-- | server/tests/plugins/translations.ts | 8 |
2 files changed, 27 insertions, 5 deletions
diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts index a947283c2..644b41dea 100644 --- a/server/tests/plugins/filter-hooks.ts +++ b/server/tests/plugins/filter-hooks.ts | |||
@@ -8,6 +8,7 @@ import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-code | |||
8 | import { | 8 | import { |
9 | addVideoCommentReply, | 9 | addVideoCommentReply, |
10 | addVideoCommentThread, | 10 | addVideoCommentThread, |
11 | advancedVideoPlaylistSearch, | ||
11 | advancedVideosSearch, | 12 | advancedVideosSearch, |
12 | createLive, | 13 | createLive, |
13 | createVideoPlaylist, | 14 | createVideoPlaylist, |
@@ -71,7 +72,7 @@ describe('Test plugin filter hooks', function () { | |||
71 | await installPlugin({ | 72 | await installPlugin({ |
72 | url: servers[0].url, | 73 | url: servers[0].url, |
73 | accessToken: servers[0].accessToken, | 74 | accessToken: servers[0].accessToken, |
74 | path: getPluginTestPath('-two') | 75 | path: getPluginTestPath('-filter-translations') |
75 | }) | 76 | }) |
76 | 77 | ||
77 | for (let i = 0; i < 10; i++) { | 78 | for (let i = 0; i < 10; i++) { |
@@ -525,6 +526,27 @@ describe('Test plugin filter hooks', function () { | |||
525 | await waitUntilLog(servers[0], 'Run hook filter:api.search.video-channels.index.list.params', 1) | 526 | await waitUntilLog(servers[0], 'Run hook filter:api.search.video-channels.index.list.params', 1) |
526 | await waitUntilLog(servers[0], 'Run hook filter:api.search.video-channels.index.list.result', 1) | 527 | await waitUntilLog(servers[0], 'Run hook filter:api.search.video-channels.index.list.result', 1) |
527 | }) | 528 | }) |
529 | |||
530 | it('Should run filter:api.search.video-playlists.local.list.{params,result}', async function () { | ||
531 | await advancedVideoPlaylistSearch(servers[0].url, { | ||
532 | search: 'Sun Jian' | ||
533 | }) | ||
534 | |||
535 | await waitUntilLog(servers[0], 'Run hook filter:api.search.video-playlists.local.list.params', 1) | ||
536 | await waitUntilLog(servers[0], 'Run hook filter:api.search.video-playlists.local.list.result', 1) | ||
537 | }) | ||
538 | |||
539 | it('Should run filter:api.search.video-playlists.index.list.{params,result}', async function () { | ||
540 | await advancedVideoPlaylistSearch(servers[0].url, { | ||
541 | search: 'Sun Jian', | ||
542 | searchTarget: 'search-index' | ||
543 | }) | ||
544 | |||
545 | await waitUntilLog(servers[0], 'Run hook filter:api.search.video-playlists.local.list.params', 1) | ||
546 | await waitUntilLog(servers[0], 'Run hook filter:api.search.video-playlists.local.list.result', 1) | ||
547 | await waitUntilLog(servers[0], 'Run hook filter:api.search.video-playlists.index.list.params', 1) | ||
548 | await waitUntilLog(servers[0], 'Run hook filter:api.search.video-playlists.index.list.result', 1) | ||
549 | }) | ||
528 | }) | 550 | }) |
529 | 551 | ||
530 | after(async function () { | 552 | after(async function () { |
diff --git a/server/tests/plugins/translations.ts b/server/tests/plugins/translations.ts index 8dc2043b8..9fd2ba1c5 100644 --- a/server/tests/plugins/translations.ts +++ b/server/tests/plugins/translations.ts | |||
@@ -31,7 +31,7 @@ describe('Test plugin translations', function () { | |||
31 | await installPlugin({ | 31 | await installPlugin({ |
32 | url: server.url, | 32 | url: server.url, |
33 | accessToken: server.accessToken, | 33 | accessToken: server.accessToken, |
34 | path: getPluginTestPath('-two') | 34 | path: getPluginTestPath('-filter-translations') |
35 | }) | 35 | }) |
36 | }) | 36 | }) |
37 | 37 | ||
@@ -48,7 +48,7 @@ describe('Test plugin translations', function () { | |||
48 | 'peertube-plugin-test': { | 48 | 'peertube-plugin-test': { |
49 | Hi: 'Coucou' | 49 | Hi: 'Coucou' |
50 | }, | 50 | }, |
51 | 'peertube-plugin-test-two': { | 51 | 'peertube-plugin-test-filter-translations': { |
52 | 'Hello world': 'Bonjour le monde' | 52 | 'Hello world': 'Bonjour le monde' |
53 | } | 53 | } |
54 | }) | 54 | }) |
@@ -58,14 +58,14 @@ describe('Test plugin translations', function () { | |||
58 | const res = await getPluginTranslations({ url: server.url, locale: 'it-IT' }) | 58 | const res = await getPluginTranslations({ url: server.url, locale: 'it-IT' }) |
59 | 59 | ||
60 | expect(res.body).to.deep.equal({ | 60 | expect(res.body).to.deep.equal({ |
61 | 'peertube-plugin-test-two': { | 61 | 'peertube-plugin-test-filter-translations': { |
62 | 'Hello world': 'Ciao, mondo!' | 62 | 'Hello world': 'Ciao, mondo!' |
63 | } | 63 | } |
64 | }) | 64 | }) |
65 | }) | 65 | }) |
66 | 66 | ||
67 | it('Should remove the plugin and remove the locales', async function () { | 67 | it('Should remove the plugin and remove the locales', async function () { |
68 | await uninstallPlugin({ url: server.url, accessToken: server.accessToken, npmName: 'peertube-plugin-test-two' }) | 68 | await uninstallPlugin({ url: server.url, accessToken: server.accessToken, npmName: 'peertube-plugin-test-filter-translations' }) |
69 | 69 | ||
70 | { | 70 | { |
71 | const res = await getPluginTranslations({ url: server.url, locale: 'fr-FR' }) | 71 | const res = await getPluginTranslations({ url: server.url, locale: 'fr-FR' }) |