+ it('Should have the video uploaded', async function () {
+ const { total, data } = await server.videos.list()
+ expect(total).to.equal(1)
+
+ const video = await server.videos.get({ id: data[0].uuid })
+ expect(video.name).to.equal('test upload')
+ expect(video.support).to.equal('support_text')
+ expect(video.channel.name).to.equal('user_channel')
+ })
+
+ it('Should import a 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}`)
+ })
+
+ it('Should have imported the video', async function () {
+ if (areHttpImportTestsDisabled()) return
+
+ this.timeout(60000)
+
+ await waitJobs([ server ])
+
+ const { total, data } = await server.videos.list()
+ expect(total).to.equal(2)
+
+ const video = data.find(v => v.name === 'small video - youtube')
+ expect(video).to.not.be.undefined
+
+ const videoDetails = await server.videos.get({ id: video.id })
+ expect(videoDetails.channel.name).to.equal('user_channel')
+ expect(videoDetails.support).to.equal('super support text')
+ expect(videoDetails.nsfw).to.be.false
+
+ // So we can reimport it
+ await server.videos.remove({ token: userAccessToken, id: video.id })
+ })