diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/tests/api/check-params/video-captions.ts | 2 | ||||
-rw-r--r-- | server/tests/api/search/search-videos.ts | 4 | ||||
-rw-r--r-- | server/tests/api/server/follows.ts | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-captions.ts | 20 | ||||
-rw-r--r-- | server/tests/api/videos/video-imports.ts | 6 |
5 files changed, 18 insertions, 18 deletions
diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.ts index 5aaeb27fe..90f429314 100644 --- a/server/tests/api/check-params/video-captions.ts +++ b/server/tests/api/check-params/video-captions.ts | |||
@@ -151,7 +151,7 @@ describe('Test video captions API validator', function () { | |||
151 | // }) | 151 | // }) |
152 | 152 | ||
153 | it('Should succeed with a valid captionfile extension and octet-stream mime type', async function () { | 153 | it('Should succeed with a valid captionfile extension and octet-stream mime type', async function () { |
154 | await server.captions.createVideoCaption({ | 154 | await server.captions.add({ |
155 | language: 'zh', | 155 | language: 'zh', |
156 | videoId: video.uuid, | 156 | videoId: video.uuid, |
157 | fixture: 'subtitle-good.srt', | 157 | fixture: 'subtitle-good.srt', |
diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts index f834c7f36..965766742 100644 --- a/server/tests/api/search/search-videos.ts +++ b/server/tests/api/search/search-videos.ts | |||
@@ -50,14 +50,14 @@ describe('Test videos search', function () { | |||
50 | const { id, uuid } = await server.videos.upload({ attributes: attributes3 }) | 50 | const { id, uuid } = await server.videos.upload({ attributes: attributes3 }) |
51 | videoUUID = uuid | 51 | videoUUID = uuid |
52 | 52 | ||
53 | await server.captions.createVideoCaption({ | 53 | await server.captions.add({ |
54 | language: 'en', | 54 | language: 'en', |
55 | videoId: id, | 55 | videoId: id, |
56 | fixture: 'subtitle-good2.vtt', | 56 | fixture: 'subtitle-good2.vtt', |
57 | mimeType: 'application/octet-stream' | 57 | mimeType: 'application/octet-stream' |
58 | }) | 58 | }) |
59 | 59 | ||
60 | await server.captions.createVideoCaption({ | 60 | await server.captions.add({ |
61 | language: 'aa', | 61 | language: 'aa', |
62 | videoId: id, | 62 | videoId: id, |
63 | fixture: 'subtitle-good2.vtt', | 63 | fixture: 'subtitle-good2.vtt', |
diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.ts index a616edcff..832ba561a 100644 --- a/server/tests/api/server/follows.ts +++ b/server/tests/api/server/follows.ts | |||
@@ -416,7 +416,7 @@ describe('Test follows', function () { | |||
416 | await servers[2].comments.delete({ videoId: video4.id, commentId: replyId }) | 416 | await servers[2].comments.delete({ videoId: video4.id, commentId: replyId }) |
417 | } | 417 | } |
418 | 418 | ||
419 | await servers[2].captions.createVideoCaption({ | 419 | await servers[2].captions.add({ |
420 | language: 'ar', | 420 | language: 'ar', |
421 | videoId: video4.id, | 421 | videoId: video4.id, |
422 | fixture: 'subtitle-good2.vtt' | 422 | fixture: 'subtitle-good2.vtt' |
@@ -569,7 +569,7 @@ describe('Test follows', function () { | |||
569 | }) | 569 | }) |
570 | 570 | ||
571 | it('Should have propagated captions', async function () { | 571 | it('Should have propagated captions', async function () { |
572 | const body = await servers[0].captions.listVideoCaptions({ videoId: video4.id }) | 572 | const body = await servers[0].captions.list({ videoId: video4.id }) |
573 | expect(body.total).to.equal(1) | 573 | expect(body.total).to.equal(1) |
574 | expect(body.data).to.have.lengthOf(1) | 574 | expect(body.data).to.have.lengthOf(1) |
575 | 575 | ||
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 | ||