diff options
Diffstat (limited to 'server/tests/api/videos/video-captions.ts')
-rw-r--r-- | server/tests/api/videos/video-captions.ts | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/server/tests/api/videos/video-captions.ts b/server/tests/api/videos/video-captions.ts index 4c67e96f7..abc07194d 100644 --- a/server/tests/api/videos/video-captions.ts +++ b/server/tests/api/videos/video-captions.ts | |||
@@ -32,7 +32,7 @@ describe('Test video captions', function () { | |||
32 | 32 | ||
33 | await waitJobs(servers) | 33 | await waitJobs(servers) |
34 | 34 | ||
35 | const { uuid } = await servers[0].videosCommand.upload({ attributes: { name: 'my video name' } }) | 35 | const { uuid } = await servers[0].videos.upload({ attributes: { name: 'my video name' } }) |
36 | videoUUID = uuid | 36 | videoUUID = uuid |
37 | 37 | ||
38 | await waitJobs(servers) | 38 | await waitJobs(servers) |
@@ -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.captionsCommand.listVideoCaptions({ videoId: videoUUID }) | 43 | const body = await server.captions.listVideoCaptions({ 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].captionsCommand.createVideoCaption({ | 52 | await servers[0].captions.createVideoCaption({ |
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].captionsCommand.createVideoCaption({ | 58 | await servers[0].captions.createVideoCaption({ |
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.captionsCommand.listVideoCaptions({ videoId: videoUUID }) | 70 | const body = await server.captions.listVideoCaptions({ 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].captionsCommand.createVideoCaption({ | 91 | await servers[0].captions.createVideoCaption({ |
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.captionsCommand.listVideoCaptions({ videoId: videoUUID }) | 102 | const body = await server.captions.listVideoCaptions({ 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].captionsCommand.createVideoCaption({ | 117 | await servers[0].captions.createVideoCaption({ |
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.captionsCommand.listVideoCaptions({ videoId: videoUUID }) | 131 | const body = await server.captions.listVideoCaptions({ 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].captionsCommand.deleteVideoCaption({ videoId: videoUUID, language: 'ar' }) | 160 | await servers[0].captions.deleteVideoCaption({ 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.captionsCommand.listVideoCaptions({ videoId: videoUUID }) | 167 | const body = await server.captions.listVideoCaptions({ 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 | ||
@@ -178,7 +178,7 @@ describe('Test video captions', function () { | |||
178 | }) | 178 | }) |
179 | 179 | ||
180 | it('Should remove the video, and thus all video captions', async function () { | 180 | it('Should remove the video, and thus all video captions', async function () { |
181 | await servers[0].videosCommand.remove({ id: videoUUID }) | 181 | await servers[0].videos.remove({ id: videoUUID }) |
182 | 182 | ||
183 | await checkVideoFilesWereRemoved(videoUUID, servers[0]) | 183 | await checkVideoFilesWereRemoved(videoUUID, servers[0]) |
184 | }) | 184 | }) |