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/api/search/search-activitypub-videos.ts | |
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/api/search/search-activitypub-videos.ts')
-rw-r--r-- | server/tests/api/search/search-activitypub-videos.ts | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/server/tests/api/search/search-activitypub-videos.ts b/server/tests/api/search/search-activitypub-videos.ts index c62dfca0d..e9b4978da 100644 --- a/server/tests/api/search/search-activitypub-videos.ts +++ b/server/tests/api/search/search-activitypub-videos.ts | |||
@@ -77,14 +77,33 @@ describe('Test ActivityPub videos search', function () { | |||
77 | expect(res.body.data[0].name).to.equal('video 1 on server 1') | 77 | expect(res.body.data[0].name).to.equal('video 1 on server 1') |
78 | }) | 78 | }) |
79 | 79 | ||
80 | it('Should search a local video with an alternative URL', async function () { | ||
81 | const search = 'http://localhost:' + servers[0].port + '/w/' + videoServer1UUID | ||
82 | const res1 = await searchVideo(servers[0].url, search) | ||
83 | const res2 = await searchVideoWithToken(servers[0].url, search, servers[0].accessToken) | ||
84 | |||
85 | for (const res of [ res1, res2 ]) { | ||
86 | expect(res.body.total).to.equal(1) | ||
87 | expect(res.body.data).to.be.an('array') | ||
88 | expect(res.body.data).to.have.lengthOf(1) | ||
89 | expect(res.body.data[0].name).to.equal('video 1 on server 1') | ||
90 | } | ||
91 | }) | ||
92 | |||
80 | it('Should search a remote video', async function () { | 93 | it('Should search a remote video', async function () { |
81 | const search = 'http://localhost:' + servers[1].port + '/videos/watch/' + videoServer2UUID | 94 | const searches = [ |
82 | const res = await searchVideoWithToken(servers[0].url, search, servers[0].accessToken) | 95 | 'http://localhost:' + servers[1].port + '/w/' + videoServer2UUID, |
96 | 'http://localhost:' + servers[1].port + '/videos/watch/' + videoServer2UUID | ||
97 | ] | ||
83 | 98 | ||
84 | expect(res.body.total).to.equal(1) | 99 | for (const search of searches) { |
85 | expect(res.body.data).to.be.an('array') | 100 | const res = await searchVideoWithToken(servers[0].url, search, servers[0].accessToken) |
86 | expect(res.body.data).to.have.lengthOf(1) | 101 | |
87 | expect(res.body.data[0].name).to.equal('video 1 on server 2') | 102 | expect(res.body.total).to.equal(1) |
103 | expect(res.body.data).to.be.an('array') | ||
104 | expect(res.body.data).to.have.lengthOf(1) | ||
105 | expect(res.body.data[0].name).to.equal('video 1 on server 2') | ||
106 | } | ||
88 | }) | 107 | }) |
89 | 108 | ||
90 | it('Should not list this remote video', async function () { | 109 | it('Should not list this remote video', async function () { |
@@ -95,7 +114,7 @@ describe('Test ActivityPub videos search', function () { | |||
95 | }) | 114 | }) |
96 | 115 | ||
97 | it('Should update video of server 2, and refresh it on server 1', async function () { | 116 | it('Should update video of server 2, and refresh it on server 1', async function () { |
98 | this.timeout(60000) | 117 | this.timeout(120000) |
99 | 118 | ||
100 | const channelAttributes = { | 119 | const channelAttributes = { |
101 | name: 'super_channel', | 120 | name: 'super_channel', |
@@ -134,7 +153,7 @@ describe('Test ActivityPub videos search', function () { | |||
134 | }) | 153 | }) |
135 | 154 | ||
136 | it('Should delete video of server 2, and delete it on server 1', async function () { | 155 | it('Should delete video of server 2, and delete it on server 1', async function () { |
137 | this.timeout(60000) | 156 | this.timeout(120000) |
138 | 157 | ||
139 | await removeVideo(servers[1].url, servers[1].accessToken, videoServer2UUID) | 158 | await removeVideo(servers[1].url, servers[1].accessToken, videoServer2UUID) |
140 | 159 | ||