From c63830f15403ac4e750829f27d8bbbdc9a59282c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 21 Jul 2021 13:58:35 +0200 Subject: Rename captions commands --- server/tests/api/videos/video-captions.ts | 20 ++++++++++---------- server/tests/api/videos/video-imports.ts | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'server/tests/api/videos') diff --git a/server/tests/api/videos/video-captions.ts b/server/tests/api/videos/video-captions.ts index e3d46e619..4c8e28adf 100644 --- a/server/tests/api/videos/video-captions.ts +++ b/server/tests/api/videos/video-captions.ts @@ -40,7 +40,7 @@ describe('Test video captions', function () { it('Should list the captions and return an empty list', async function () { for (const server of servers) { - const body = await server.captions.listVideoCaptions({ videoId: videoUUID }) + const body = await server.captions.list({ videoId: videoUUID }) expect(body.total).to.equal(0) expect(body.data).to.have.lengthOf(0) } @@ -49,13 +49,13 @@ describe('Test video captions', function () { it('Should create two new captions', async function () { this.timeout(30000) - await servers[0].captions.createVideoCaption({ + await servers[0].captions.add({ language: 'ar', videoId: videoUUID, fixture: 'subtitle-good1.vtt' }) - await servers[0].captions.createVideoCaption({ + await servers[0].captions.add({ language: 'zh', videoId: videoUUID, fixture: 'subtitle-good2.vtt', @@ -67,7 +67,7 @@ describe('Test video captions', function () { it('Should list these uploaded captions', async function () { for (const server of servers) { - const body = await server.captions.listVideoCaptions({ videoId: videoUUID }) + const body = await server.captions.list({ videoId: videoUUID }) expect(body.total).to.equal(2) expect(body.data).to.have.lengthOf(2) @@ -88,7 +88,7 @@ describe('Test video captions', function () { it('Should replace an existing caption', async function () { this.timeout(30000) - await servers[0].captions.createVideoCaption({ + await servers[0].captions.add({ language: 'ar', videoId: videoUUID, fixture: 'subtitle-good2.vtt' @@ -99,7 +99,7 @@ describe('Test video captions', function () { it('Should have this caption updated', async function () { for (const server of servers) { - const body = await server.captions.listVideoCaptions({ videoId: videoUUID }) + const body = await server.captions.list({ videoId: videoUUID }) expect(body.total).to.equal(2) expect(body.data).to.have.lengthOf(2) @@ -114,7 +114,7 @@ describe('Test video captions', function () { it('Should replace an existing caption with a srt file and convert it', async function () { this.timeout(30000) - await servers[0].captions.createVideoCaption({ + await servers[0].captions.add({ language: 'ar', videoId: videoUUID, fixture: 'subtitle-good.srt' @@ -128,7 +128,7 @@ describe('Test video captions', function () { it('Should have this caption updated and converted', async function () { for (const server of servers) { - const body = await server.captions.listVideoCaptions({ videoId: videoUUID }) + const body = await server.captions.list({ videoId: videoUUID }) expect(body.total).to.equal(2) expect(body.data).to.have.lengthOf(2) @@ -157,14 +157,14 @@ describe('Test video captions', function () { it('Should remove one caption', async function () { this.timeout(30000) - await servers[0].captions.deleteVideoCaption({ videoId: videoUUID, language: 'ar' }) + await servers[0].captions.delete({ videoId: videoUUID, language: 'ar' }) await waitJobs(servers) }) it('Should only list the caption that was not deleted', async function () { for (const server of servers) { - const body = await server.captions.listVideoCaptions({ videoId: videoUUID }) + const body = await server.captions.list({ videoId: videoUUID }) expect(body.total).to.equal(1) expect(body.data).to.have.lengthOf(1) diff --git a/server/tests/api/videos/video-imports.ts b/server/tests/api/videos/video-imports.ts index 192f5232e..2eac130d2 100644 --- a/server/tests/api/videos/video-imports.ts +++ b/server/tests/api/videos/video-imports.ts @@ -59,7 +59,7 @@ describe('Test video imports', function () { expect(videoTorrent.name).to.contain('你好 世界 720p.mp4') expect(videoMagnet.name).to.contain('super peertube2 video') - const bodyCaptions = await server.captions.listVideoCaptions({ videoId: idHttp }) + const bodyCaptions = await server.captions.list({ videoId: idHttp }) expect(bodyCaptions.total).to.equal(2) } @@ -76,7 +76,7 @@ describe('Test video imports', function () { expect(video.files).to.have.lengthOf(1) - const bodyCaptions = await server.captions.listVideoCaptions({ videoId: id }) + const bodyCaptions = await server.captions.list({ videoId: id }) expect(bodyCaptions.total).to.equal(2) } @@ -120,7 +120,7 @@ describe('Test video imports', function () { await testImage(servers[0].url, 'video_import_thumbnail', video.thumbnailPath) await testImage(servers[0].url, 'video_import_preview', video.previewPath) - const bodyCaptions = await servers[0].captions.listVideoCaptions({ videoId: video.id }) + const bodyCaptions = await servers[0].captions.list({ videoId: video.id }) const videoCaptions = bodyCaptions.data expect(videoCaptions).to.have.lengthOf(2) -- cgit v1.2.3