X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-imports.ts;h=192b2aeb9ae7c705090ee2ecf90d1eaeb23e8ef0;hb=HEAD;hp=5636de45f7144c55be37deeaf6c6fc62c1686344;hpb=8ca52bcc2c37d457e8b19a237c66b8dd1c00b6b9;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-imports.ts b/server/tests/api/videos/video-imports.ts index 5636de45f..192b2aeb9 100644 --- a/server/tests/api/videos/video-imports.ts +++ b/server/tests/api/videos/video-imports.ts @@ -23,9 +23,8 @@ async function checkVideosServer1 (server: PeerTubeServer, idHttp: string, idMag const videoHttp = await server.videos.get({ id: idHttp }) expect(videoHttp.name).to.equal('small video - youtube') - // FIXME: youtube-dl seems broken - // expect(videoHttp.category.label).to.equal('News & Politics') - // expect(videoHttp.licence.label).to.equal('Attribution') + expect(videoHttp.category.label).to.equal('News & Politics') + expect(videoHttp.licence.label).to.equal('Attribution') expect(videoHttp.language.label).to.equal('Unknown') expect(videoHttp.nsfw).to.be.false expect(videoHttp.description).to.equal('this is a super description') @@ -68,6 +67,8 @@ async function checkVideoServer2 (server: PeerTubeServer, id: number | string) { expect(video.description).to.equal('my super description') expect(video.tags).to.deep.equal([ 'supertag1', 'supertag2' ]) + await testImage(server.url, 'thumbnail', video.thumbnailPath) + expect(video.files).to.have.lengthOf(1) const bodyCaptions = await server.captions.list({ videoId: id }) @@ -254,18 +255,20 @@ describe('Test video imports', function () { it('Should import a video on server 2 with some fields', async function () { this.timeout(60_000) - const attributes = { - targetUrl: FIXTURE_URLS.youtube, - channelId: servers[1].store.channel.id, - privacy: VideoPrivacy.PUBLIC, - category: 10, - licence: 7, - language: 'en', - name: 'my super name', - description: 'my super description', - tags: [ 'supertag1', 'supertag2' ] - } - const { video } = await servers[1].imports.importVideo({ attributes }) + const { video } = await servers[1].imports.importVideo({ + attributes: { + targetUrl: FIXTURE_URLS.youtube, + channelId: servers[1].store.channel.id, + privacy: VideoPrivacy.PUBLIC, + category: 10, + licence: 7, + language: 'en', + name: 'my super name', + description: 'my super description', + tags: [ 'supertag1', 'supertag2' ], + thumbnailfile: 'thumbnail.jpg' + } + }) expect(video.name).to.equal('my super name') }) @@ -446,6 +449,16 @@ describe('Test video imports', function () { const video = await server.videos.get({ id: videoUUID }) expect(video.name).to.equal('E2E tests') + + const { data: captions } = await server.captions.list({ videoId: videoUUID }) + expect(captions).to.have.lengthOf(1) + expect(captions[0].language.id).to.equal('fr') + + const str = `WEBVTT FILE\r?\n\r?\n` + + `1\r?\n` + + `00:00:04.000 --> 00:00:09.000\r?\n` + + `January 1, 1994. The North American` + await testCaptionFile(server.url, captions[0].captionPath, new RegExp(str)) } } }) @@ -456,7 +469,8 @@ describe('Test video imports', function () { }) } - runSuite('youtube-dl') + // FIXME: youtube-dl seems broken + // runSuite('youtube-dl') runSuite('yt-dlp')