From d511df28906f84c7d25ecb24e41515ed549ff276 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Jan 2022 14:58:16 +0100 Subject: Add ability to filter my imports by target URL --- server/tests/cli/peertube.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'server/tests/cli/peertube.ts') 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 () { expect(videoDetails.channel.name).to.equal('user_channel') expect(videoDetails.support).to.equal('super support text') expect(videoDetails.nsfw).to.be.false + }) + + it('Should not import again the same video', async function () { + if (areHttpImportTestsDisabled()) return + + this.timeout(60000) + + const params = `--target-url ${FIXTURE_URLS.youtube} --channel-name user_channel` + await cliCommand.execWithEnv(`${cmd} import ${params}`) + + await waitJobs([ server ]) + + const { total, data } = await server.videos.list() + expect(total).to.equal(2) + + const videos = data.filter(v => v.name === 'small video - youtube') + expect(videos).to.have.lengthOf(1) // So we can reimport it - await server.videos.remove({ token: userAccessToken, id: video.id }) + await server.videos.remove({ token: userAccessToken, id: videos[0].id }) }) it('Should import and override some imported attributes', async function () { -- cgit v1.2.3