aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/video-captions.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-21 13:58:35 +0200
committerChocobozzz <me@florianbigard.com>2021-07-21 13:58:35 +0200
commitc63830f15403ac4e750829f27d8bbbdc9a59282c (patch)
treef35048f1b2249bb3eec916964c084b1cd60f7bf3 /server/tests/api/videos/video-captions.ts
parent4d029ef8ec3d5274eeaa3ee6d808eb7035e7faef (diff)
downloadPeerTube-c63830f15403ac4e750829f27d8bbbdc9a59282c.tar.gz
PeerTube-c63830f15403ac4e750829f27d8bbbdc9a59282c.tar.zst
PeerTube-c63830f15403ac4e750829f27d8bbbdc9a59282c.zip
Rename captions commands
Diffstat (limited to 'server/tests/api/videos/video-captions.ts')
-rw-r--r--server/tests/api/videos/video-captions.ts20
1 files changed, 10 insertions, 10 deletions
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 () {
40 40
41 it('Should list the captions and return an empty list', async function () { 41 it('Should list the captions and return an empty list', async function () {
42 for (const server of servers) { 42 for (const server of servers) {
43 const body = await server.captions.listVideoCaptions({ videoId: videoUUID }) 43 const body = await server.captions.list({ videoId: videoUUID })
44 expect(body.total).to.equal(0) 44 expect(body.total).to.equal(0)
45 expect(body.data).to.have.lengthOf(0) 45 expect(body.data).to.have.lengthOf(0)
46 } 46 }
@@ -49,13 +49,13 @@ describe('Test video captions', function () {
49 it('Should create two new captions', async function () { 49 it('Should create two new captions', async function () {
50 this.timeout(30000) 50 this.timeout(30000)
51 51
52 await servers[0].captions.createVideoCaption({ 52 await servers[0].captions.add({
53 language: 'ar', 53 language: 'ar',
54 videoId: videoUUID, 54 videoId: videoUUID,
55 fixture: 'subtitle-good1.vtt' 55 fixture: 'subtitle-good1.vtt'
56 }) 56 })
57 57
58 await servers[0].captions.createVideoCaption({ 58 await servers[0].captions.add({
59 language: 'zh', 59 language: 'zh',
60 videoId: videoUUID, 60 videoId: videoUUID,
61 fixture: 'subtitle-good2.vtt', 61 fixture: 'subtitle-good2.vtt',
@@ -67,7 +67,7 @@ describe('Test video captions', function () {
67 67
68 it('Should list these uploaded captions', async function () { 68 it('Should list these uploaded captions', async function () {
69 for (const server of servers) { 69 for (const server of servers) {
70 const body = await server.captions.listVideoCaptions({ videoId: videoUUID }) 70 const body = await server.captions.list({ videoId: videoUUID })
71 expect(body.total).to.equal(2) 71 expect(body.total).to.equal(2)
72 expect(body.data).to.have.lengthOf(2) 72 expect(body.data).to.have.lengthOf(2)
73 73
@@ -88,7 +88,7 @@ describe('Test video captions', function () {
88 it('Should replace an existing caption', async function () { 88 it('Should replace an existing caption', async function () {
89 this.timeout(30000) 89 this.timeout(30000)
90 90
91 await servers[0].captions.createVideoCaption({ 91 await servers[0].captions.add({
92 language: 'ar', 92 language: 'ar',
93 videoId: videoUUID, 93 videoId: videoUUID,
94 fixture: 'subtitle-good2.vtt' 94 fixture: 'subtitle-good2.vtt'
@@ -99,7 +99,7 @@ describe('Test video captions', function () {
99 99
100 it('Should have this caption updated', async function () { 100 it('Should have this caption updated', async function () {
101 for (const server of servers) { 101 for (const server of servers) {
102 const body = await server.captions.listVideoCaptions({ videoId: videoUUID }) 102 const body = await server.captions.list({ videoId: videoUUID })
103 expect(body.total).to.equal(2) 103 expect(body.total).to.equal(2)
104 expect(body.data).to.have.lengthOf(2) 104 expect(body.data).to.have.lengthOf(2)
105 105
@@ -114,7 +114,7 @@ describe('Test video captions', function () {
114 it('Should replace an existing caption with a srt file and convert it', async function () { 114 it('Should replace an existing caption with a srt file and convert it', async function () {
115 this.timeout(30000) 115 this.timeout(30000)
116 116
117 await servers[0].captions.createVideoCaption({ 117 await servers[0].captions.add({
118 language: 'ar', 118 language: 'ar',
119 videoId: videoUUID, 119 videoId: videoUUID,
120 fixture: 'subtitle-good.srt' 120 fixture: 'subtitle-good.srt'
@@ -128,7 +128,7 @@ describe('Test video captions', function () {
128 128
129 it('Should have this caption updated and converted', async function () { 129 it('Should have this caption updated and converted', async function () {
130 for (const server of servers) { 130 for (const server of servers) {
131 const body = await server.captions.listVideoCaptions({ videoId: videoUUID }) 131 const body = await server.captions.list({ videoId: videoUUID })
132 expect(body.total).to.equal(2) 132 expect(body.total).to.equal(2)
133 expect(body.data).to.have.lengthOf(2) 133 expect(body.data).to.have.lengthOf(2)
134 134
@@ -157,14 +157,14 @@ describe('Test video captions', function () {
157 it('Should remove one caption', async function () { 157 it('Should remove one caption', async function () {
158 this.timeout(30000) 158 this.timeout(30000)
159 159
160 await servers[0].captions.deleteVideoCaption({ videoId: videoUUID, language: 'ar' }) 160 await servers[0].captions.delete({ videoId: videoUUID, language: 'ar' })
161 161
162 await waitJobs(servers) 162 await waitJobs(servers)
163 }) 163 })
164 164
165 it('Should only list the caption that was not deleted', async function () { 165 it('Should only list the caption that was not deleted', async function () {
166 for (const server of servers) { 166 for (const server of servers) {
167 const body = await server.captions.listVideoCaptions({ videoId: videoUUID }) 167 const body = await server.captions.list({ videoId: videoUUID })
168 expect(body.total).to.equal(1) 168 expect(body.total).to.equal(1)
169 expect(body.data).to.have.lengthOf(1) 169 expect(body.data).to.have.lengthOf(1)
170 170