diff options
author | Chocobozzz <me@florianbigard.com> | 2022-01-19 14:58:16 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-01-19 14:58:16 +0100 |
commit | d511df28906f84c7d25ecb24e41515ed549ff276 (patch) | |
tree | bc9caa33fae684e9971068011dd10243c7d0fe60 /server/tests | |
parent | 419b520ca4434d17f3505013174e195c3a316716 (diff) | |
download | PeerTube-d511df28906f84c7d25ecb24e41515ed549ff276.tar.gz PeerTube-d511df28906f84c7d25ecb24e41515ed549ff276.tar.zst PeerTube-d511df28906f84c7d25ecb24e41515ed549ff276.zip |
Add ability to filter my imports by target URL
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/videos/video-imports.ts | 12 | ||||
-rw-r--r-- | server/tests/cli/peertube.ts | 19 |
2 files changed, 30 insertions, 1 deletions
diff --git a/server/tests/api/videos/video-imports.ts b/server/tests/api/videos/video-imports.ts index ba21ab17a..28da69e8e 100644 --- a/server/tests/api/videos/video-imports.ts +++ b/server/tests/api/videos/video-imports.ts | |||
@@ -219,6 +219,14 @@ describe('Test video imports', function () { | |||
219 | expect(videoImports[0].video.name).to.equal('你好 世界 720p.mp4') | 219 | expect(videoImports[0].video.name).to.equal('你好 世界 720p.mp4') |
220 | }) | 220 | }) |
221 | 221 | ||
222 | it('Should filter my imports on target URL', async function () { | ||
223 | const { total, data: videoImports } = await servers[0].imports.getMyVideoImports({ targetUrl: FIXTURE_URLS.youtube }) | ||
224 | expect(total).to.equal(1) | ||
225 | expect(videoImports).to.have.lengthOf(1) | ||
226 | |||
227 | expect(videoImports[0].targetUrl).to.equal(FIXTURE_URLS.youtube) | ||
228 | }) | ||
229 | |||
222 | it('Should have the video listed on the two instances', async function () { | 230 | it('Should have the video listed on the two instances', async function () { |
223 | this.timeout(120_000) | 231 | this.timeout(120_000) |
224 | 232 | ||
@@ -459,6 +467,10 @@ describe('Test video imports', function () { | |||
459 | const { data } = await server.imports.getMyVideoImports() | 467 | const { data } = await server.imports.getMyVideoImports() |
460 | expect(data).to.have.lengthOf(0) | 468 | expect(data).to.have.lengthOf(0) |
461 | }) | 469 | }) |
470 | |||
471 | after(async function () { | ||
472 | await cleanupTests([ server ]) | ||
473 | }) | ||
462 | }) | 474 | }) |
463 | 475 | ||
464 | describe('Auto update', function () { | 476 | describe('Auto update', function () { |
diff --git a/server/tests/cli/peertube.ts b/server/tests/cli/peertube.ts index 034d216e3..3aa24a0f8 100644 --- a/server/tests/cli/peertube.ts +++ b/server/tests/cli/peertube.ts | |||
@@ -136,9 +136,26 @@ describe('Test CLI wrapper', function () { | |||
136 | expect(videoDetails.channel.name).to.equal('user_channel') | 136 | expect(videoDetails.channel.name).to.equal('user_channel') |
137 | expect(videoDetails.support).to.equal('super support text') | 137 | expect(videoDetails.support).to.equal('super support text') |
138 | expect(videoDetails.nsfw).to.be.false | 138 | expect(videoDetails.nsfw).to.be.false |
139 | }) | ||
140 | |||
141 | it('Should not import again the same video', async function () { | ||
142 | if (areHttpImportTestsDisabled()) return | ||
143 | |||
144 | this.timeout(60000) | ||
145 | |||
146 | const params = `--target-url ${FIXTURE_URLS.youtube} --channel-name user_channel` | ||
147 | await cliCommand.execWithEnv(`${cmd} import ${params}`) | ||
148 | |||
149 | await waitJobs([ server ]) | ||
150 | |||
151 | const { total, data } = await server.videos.list() | ||
152 | expect(total).to.equal(2) | ||
153 | |||
154 | const videos = data.filter(v => v.name === 'small video - youtube') | ||
155 | expect(videos).to.have.lengthOf(1) | ||
139 | 156 | ||
140 | // So we can reimport it | 157 | // So we can reimport it |
141 | await server.videos.remove({ token: userAccessToken, id: video.id }) | 158 | await server.videos.remove({ token: userAccessToken, id: videos[0].id }) |
142 | }) | 159 | }) |
143 | 160 | ||
144 | it('Should import and override some imported attributes', async function () { | 161 | it('Should import and override some imported attributes', async function () { |