]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-captions.ts
Merge branch 'release/3.3.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-captions.ts
index e3d46e6199c9f157e220b7f5317bde2933aeb244..4c8e28adf25a0ae5e4be22c0ea19eb7cc6e71d6e 100644 (file)
@@ -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)