aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r--server/tests/api/videos/video-captions.ts20
-rw-r--r--server/tests/api/videos/video-imports.ts6
2 files changed, 13 insertions, 13 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
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 () {
59 expect(videoTorrent.name).to.contain('你好 世界 720p.mp4') 59 expect(videoTorrent.name).to.contain('你好 世界 720p.mp4')
60 expect(videoMagnet.name).to.contain('super peertube2 video') 60 expect(videoMagnet.name).to.contain('super peertube2 video')
61 61
62 const bodyCaptions = await server.captions.listVideoCaptions({ videoId: idHttp }) 62 const bodyCaptions = await server.captions.list({ videoId: idHttp })
63 expect(bodyCaptions.total).to.equal(2) 63 expect(bodyCaptions.total).to.equal(2)
64 } 64 }
65 65
@@ -76,7 +76,7 @@ describe('Test video imports', function () {
76 76
77 expect(video.files).to.have.lengthOf(1) 77 expect(video.files).to.have.lengthOf(1)
78 78
79 const bodyCaptions = await server.captions.listVideoCaptions({ videoId: id }) 79 const bodyCaptions = await server.captions.list({ videoId: id })
80 expect(bodyCaptions.total).to.equal(2) 80 expect(bodyCaptions.total).to.equal(2)
81 } 81 }
82 82
@@ -120,7 +120,7 @@ describe('Test video imports', function () {
120 await testImage(servers[0].url, 'video_import_thumbnail', video.thumbnailPath) 120 await testImage(servers[0].url, 'video_import_thumbnail', video.thumbnailPath)
121 await testImage(servers[0].url, 'video_import_preview', video.previewPath) 121 await testImage(servers[0].url, 'video_import_preview', video.previewPath)
122 122
123 const bodyCaptions = await servers[0].captions.listVideoCaptions({ videoId: video.id }) 123 const bodyCaptions = await servers[0].captions.list({ videoId: video.id })
124 const videoCaptions = bodyCaptions.data 124 const videoCaptions = bodyCaptions.data
125 expect(videoCaptions).to.have.lengthOf(2) 125 expect(videoCaptions).to.have.lengthOf(2)
126 126