]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/api/check-params/videos.ts
Merge branch 'develop' into pr/1285
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / videos.ts
1 /* tslint:disable:no-unused-expression */
2
3 import * as chai from 'chai'
4 import { omit } from 'lodash'
5 import 'mocha'
6 import { join } from 'path'
7 import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum'
8 import {
9 createUser, flushTests, getMyUserInformation, getVideo, getVideosList, immutableAssign, killallServers, makeDeleteRequest,
10 makeGetRequest, makeUploadRequest, makePutBodyRequest, removeVideo, runServer, ServerInfo, setAccessTokensToServers, userLogin
11 } from '../../../../shared/utils'
12 import {
13 checkBadCountPagination,
14 checkBadSortPagination,
15 checkBadStartPagination
16 } from '../../../../shared/utils/requests/check-api-params'
17 import { getAccountsList } from '../../../../shared/utils/users/accounts'
18
19 const expect = chai.expect
20
21 describe('Test videos API validator', function () {
22 const path = '/api/v1/videos/'
23 let server: ServerInfo
24 let userAccessToken = ''
25 let accountName: string
26 let channelId: number
27 let channelName: string
28 let videoId
29
30 // ---------------------------------------------------------------
31
32 before(async function () {
33 this.timeout(30000)
34
35 await flushTests()
36
37 server = await runServer(1)
38
39 await setAccessTokensToServers([ server ])
40
41 const username = 'user1'
42 const password = 'my super password'
43 await createUser(server.url, server.accessToken, username, password)
44 userAccessToken = await userLogin(server, { username, password })
45
46 {
47 const res = await getMyUserInformation(server.url, server.accessToken)
48 channelId = res.body.videoChannels[ 0 ].id
49 channelName = res.body.videoChannels[ 0 ].name
50 accountName = res.body.account.name + '@' + res.body.account.host
51 }
52 })
53
54 describe('When listing a video', function () {
55 it('Should fail with a bad start pagination', async function () {
56 await checkBadStartPagination(server.url, path)
57 })
58
59 it('Should fail with a bad count pagination', async function () {
60 await checkBadCountPagination(server.url, path)
61 })
62
63 it('Should fail with an incorrect sort', async function () {
64 await checkBadSortPagination(server.url, path)
65 })
66
67 it('Should success with the correct parameters', async function () {
68 await makeGetRequest({ url: server.url, path, statusCodeExpected: 200 })
69 })
70 })
71
72 describe('When searching a video', function () {
73
74 it('Should fail with nothing', async function () {
75 await makeGetRequest({
76 url: server.url,
77 path: join(path, 'search'),
78 statusCodeExpected: 400
79 })
80 })
81
82 it('Should fail with a bad start pagination', async function () {
83 await checkBadStartPagination(server.url, join(path, 'search', 'test'))
84 })
85
86 it('Should fail with a bad count pagination', async function () {
87 await checkBadCountPagination(server.url, join(path, 'search', 'test'))
88 })
89
90 it('Should fail with an incorrect sort', async function () {
91 await checkBadSortPagination(server.url, join(path, 'search', 'test'))
92 })
93
94 it('Should success with the correct parameters', async function () {
95 await makeGetRequest({ url: server.url, path, statusCodeExpected: 200 })
96 })
97 })
98
99 describe('When listing my videos', function () {
100 const path = '/api/v1/users/me/videos'
101
102 it('Should fail with a bad start pagination', async function () {
103 await checkBadStartPagination(server.url, path, server.accessToken)
104 })
105
106 it('Should fail with a bad count pagination', async function () {
107 await checkBadCountPagination(server.url, path, server.accessToken)
108 })
109
110 it('Should fail with an incorrect sort', async function () {
111 await checkBadSortPagination(server.url, path, server.accessToken)
112 })
113
114 it('Should success with the correct parameters', async function () {
115 await makeGetRequest({ url: server.url, token: server.accessToken, path, statusCodeExpected: 200 })
116 })
117 })
118
119 describe('When listing account videos', function () {
120 let path: string
121
122 before(async function () {
123 path = '/api/v1/accounts/' + accountName + '/videos'
124 })
125
126 it('Should fail with a bad start pagination', async function () {
127 await checkBadStartPagination(server.url, path, server.accessToken)
128 })
129
130 it('Should fail with a bad count pagination', async function () {
131 await checkBadCountPagination(server.url, path, server.accessToken)
132 })
133
134 it('Should fail with an incorrect sort', async function () {
135 await checkBadSortPagination(server.url, path, server.accessToken)
136 })
137
138 it('Should success with the correct parameters', async function () {
139 await makeGetRequest({ url: server.url, path, statusCodeExpected: 200 })
140 })
141 })
142
143 describe('When listing video channel videos', function () {
144 let path: string
145
146 before(async function () {
147 path = '/api/v1/video-channels/' + channelName + '/videos'
148 })
149
150 it('Should fail with a bad start pagination', async function () {
151 await checkBadStartPagination(server.url, path, server.accessToken)
152 })
153
154 it('Should fail with a bad count pagination', async function () {
155 await checkBadCountPagination(server.url, path, server.accessToken)
156 })
157
158 it('Should fail with an incorrect sort', async function () {
159 await checkBadSortPagination(server.url, path, server.accessToken)
160 })
161
162 it('Should success with the correct parameters', async function () {
163 await makeGetRequest({ url: server.url, path, statusCodeExpected: 200 })
164 })
165 })
166
167 describe('When adding a video', function () {
168 let baseCorrectParams
169 const baseCorrectAttaches = {
170 'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short.webm')
171 }
172
173 before(function () {
174 // Put in before to have channelId
175 baseCorrectParams = {
176 name: 'my super name',
177 category: 5,
178 licence: 1,
179 language: 'pt',
180 nsfw: false,
181 commentsEnabled: true,
182 downloadEnabled: true,
183 waitTranscoding: true,
184 description: 'my super description',
185 support: 'my super support text',
186 tags: [ 'tag1', 'tag2' ],
187 privacy: VideoPrivacy.PUBLIC,
188 channelId: channelId
189 }
190 })
191
192 it('Should fail with nothing', async function () {
193 const fields = {}
194 const attaches = {}
195 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
196 })
197
198 it('Should fail without name', async function () {
199 const fields = omit(baseCorrectParams, 'name')
200 const attaches = baseCorrectAttaches
201
202 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
203 })
204
205 it('Should fail with a long name', async function () {
206 const fields = immutableAssign(baseCorrectParams, { name: 'super'.repeat(65) })
207 const attaches = baseCorrectAttaches
208
209 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
210 })
211
212 it('Should fail with a bad category', async function () {
213 const fields = immutableAssign(baseCorrectParams, { category: 125 })
214 const attaches = baseCorrectAttaches
215
216 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
217 })
218
219 it('Should fail with a bad licence', async function () {
220 const fields = immutableAssign(baseCorrectParams, { licence: 125 })
221 const attaches = baseCorrectAttaches
222
223 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
224 })
225
226 it('Should fail with a bad language', async function () {
227 const fields = immutableAssign(baseCorrectParams, { language: 'a'.repeat(15) })
228 const attaches = baseCorrectAttaches
229
230 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
231 })
232
233 it('Should fail with a long description', async function () {
234 const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(2500) })
235 const attaches = baseCorrectAttaches
236
237 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
238 })
239
240 it('Should fail with a long support text', async function () {
241 const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(201) })
242 const attaches = baseCorrectAttaches
243
244 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
245 })
246
247 it('Should fail without a channel', async function () {
248 const fields = omit(baseCorrectParams, 'channelId')
249 const attaches = baseCorrectAttaches
250
251 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
252 })
253
254 it('Should fail with a bad channel', async function () {
255 const fields = immutableAssign(baseCorrectParams, { channelId: 545454 })
256 const attaches = baseCorrectAttaches
257
258 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
259 })
260
261 it('Should fail with another user channel', async function () {
262 const user = {
263 username: 'fake',
264 password: 'fake_password'
265 }
266 await createUser(server.url, server.accessToken, user.username, user.password)
267
268 const accessTokenUser = await userLogin(server, user)
269 const res = await getMyUserInformation(server.url, accessTokenUser)
270 const customChannelId = res.body.videoChannels[0].id
271
272 const fields = immutableAssign(baseCorrectParams, { channelId: customChannelId })
273 const attaches = baseCorrectAttaches
274
275 await makeUploadRequest({ url: server.url, path: path + '/upload', token: userAccessToken, fields, attaches })
276 })
277
278 it('Should fail with too many tags', async function () {
279 const fields = immutableAssign(baseCorrectParams, { tags: [ 'tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6' ] })
280 const attaches = baseCorrectAttaches
281
282 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
283 })
284
285 it('Should fail with a tag length too low', async function () {
286 const fields = immutableAssign(baseCorrectParams, { tags: [ 'tag1', 't' ] })
287 const attaches = baseCorrectAttaches
288
289 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
290 })
291
292 it('Should fail with a tag length too big', async function () {
293 const fields = immutableAssign(baseCorrectParams, { tags: [ 'tag1', 'my_super_tag_too_long_long_long_long_long_long' ] })
294 const attaches = baseCorrectAttaches
295
296 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
297 })
298
299 it('Should fail with a bad schedule update (miss updateAt)', async function () {
300 const fields = immutableAssign(baseCorrectParams, { 'scheduleUpdate[privacy]': VideoPrivacy.PUBLIC })
301 const attaches = baseCorrectAttaches
302
303 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
304 })
305
306 it('Should fail with a bad schedule update (wrong updateAt)', async function () {
307 const fields = immutableAssign(baseCorrectParams, {
308 'scheduleUpdate[privacy]': VideoPrivacy.PUBLIC,
309 'scheduleUpdate[updateAt]': 'toto'
310 })
311 const attaches = baseCorrectAttaches
312
313 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
314 })
315
316 it('Should fail without an input file', async function () {
317 const fields = baseCorrectParams
318 const attaches = {}
319 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
320 })
321
322 it('Should fail without an incorrect input file', async function () {
323 const fields = baseCorrectParams
324 let attaches = {
325 'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short_fake.webm')
326 }
327 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
328
329 attaches = {
330 'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short.mkv')
331 }
332 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
333 })
334
335 it('Should fail with an incorrect thumbnail file', async function () {
336 const fields = baseCorrectParams
337 const attaches = {
338 'thumbnailfile': join(__dirname, '..', '..', 'fixtures', 'avatar.png'),
339 'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short.mp4')
340 }
341
342 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
343 })
344
345 it('Should fail with a big thumbnail file', async function () {
346 const fields = baseCorrectParams
347 const attaches = {
348 'thumbnailfile': join(__dirname, '..', '..', 'fixtures', 'avatar-big.png'),
349 'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short.mp4')
350 }
351
352 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
353 })
354
355 it('Should fail with an incorrect preview file', async function () {
356 const fields = baseCorrectParams
357 const attaches = {
358 'previewfile': join(__dirname, '..', '..', 'fixtures', 'avatar.png'),
359 'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short.mp4')
360 }
361
362 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
363 })
364
365 it('Should fail with a big preview file', async function () {
366 const fields = baseCorrectParams
367 const attaches = {
368 'previewfile': join(__dirname, '..', '..', 'fixtures', 'avatar-big.png'),
369 'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short.mp4')
370 }
371
372 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
373 })
374
375 it('Should succeed with the correct parameters', async function () {
376 this.timeout(10000)
377
378 const fields = baseCorrectParams
379
380 {
381 const attaches = baseCorrectAttaches
382 await makeUploadRequest({
383 url: server.url,
384 path: path + '/upload',
385 token: server.accessToken,
386 fields,
387 attaches,
388 statusCodeExpected: 200
389 })
390 }
391
392 {
393 const attaches = immutableAssign(baseCorrectAttaches, {
394 videofile: join(__dirname, '..', '..', 'fixtures', 'video_short.mp4')
395 })
396
397 await makeUploadRequest({
398 url: server.url,
399 path: path + '/upload',
400 token: server.accessToken,
401 fields,
402 attaches,
403 statusCodeExpected: 200
404 })
405 }
406
407 {
408 const attaches = immutableAssign(baseCorrectAttaches, {
409 videofile: join(__dirname, '..', '..', 'fixtures', 'video_short.ogv')
410 })
411
412 await makeUploadRequest({
413 url: server.url,
414 path: path + '/upload',
415 token: server.accessToken,
416 fields,
417 attaches,
418 statusCodeExpected: 200
419 })
420 }
421 })
422 })
423
424 describe('When updating a video', function () {
425 const baseCorrectParams = {
426 name: 'my super name',
427 category: 5,
428 licence: 2,
429 language: 'pt',
430 nsfw: false,
431 commentsEnabled: false,
432 downloadEnabled: false,
433 description: 'my super description',
434 privacy: VideoPrivacy.PUBLIC,
435 tags: [ 'tag1', 'tag2' ]
436 }
437
438 before(async function () {
439 const res = await getVideosList(server.url)
440 videoId = res.body.data[0].uuid
441 })
442
443 it('Should fail with nothing', async function () {
444 const fields = {}
445 await makePutBodyRequest({ url: server.url, path, token: server.accessToken, fields })
446 })
447
448 it('Should fail without a valid uuid', async function () {
449 const fields = baseCorrectParams
450 await makePutBodyRequest({ url: server.url, path: path + 'blabla', token: server.accessToken, fields })
451 })
452
453 it('Should fail with an unknown id', async function () {
454 const fields = baseCorrectParams
455
456 await makePutBodyRequest({
457 url: server.url,
458 path: path + '4da6fde3-88f7-4d16-b119-108df5630b06',
459 token: server.accessToken,
460 fields,
461 statusCodeExpected: 404
462 })
463 })
464
465 it('Should fail with a long name', async function () {
466 const fields = immutableAssign(baseCorrectParams, { name: 'super'.repeat(65) })
467
468 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
469 })
470
471 it('Should fail with a bad category', async function () {
472 const fields = immutableAssign(baseCorrectParams, { category: 125 })
473
474 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
475 })
476
477 it('Should fail with a bad licence', async function () {
478 const fields = immutableAssign(baseCorrectParams, { licence: 125 })
479
480 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
481 })
482
483 it('Should fail with a bad language', async function () {
484 const fields = immutableAssign(baseCorrectParams, { language: 'a'.repeat(15) })
485
486 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
487 })
488
489 it('Should fail with a long description', async function () {
490 const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(2500) })
491
492 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
493 })
494
495 it('Should fail with a long support text', async function () {
496 const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(201) })
497
498 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
499 })
500
501 it('Should fail with a bad channel', async function () {
502 const fields = immutableAssign(baseCorrectParams, { channelId: 545454 })
503
504 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
505 })
506
507 it('Should fail with too many tags', async function () {
508 const fields = immutableAssign(baseCorrectParams, { tags: [ 'tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6' ] })
509
510 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
511 })
512
513 it('Should fail with a tag length too low', async function () {
514 const fields = immutableAssign(baseCorrectParams, { tags: [ 'tag1', 't' ] })
515
516 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
517 })
518
519 it('Should fail with a tag length too big', async function () {
520 const fields = immutableAssign(baseCorrectParams, { tags: [ 'tag1', 'my_super_tag_too_long_long_long_long_long_long' ] })
521
522 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
523 })
524
525 it('Should fail with a bad schedule update (miss updateAt)', async function () {
526 const fields = immutableAssign(baseCorrectParams, { scheduleUpdate: { privacy: VideoPrivacy.PUBLIC } })
527
528 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
529 })
530
531 it('Should fail with a bad schedule update (wrong updateAt)', async function () {
532 const fields = immutableAssign(baseCorrectParams, { scheduleUpdate: { updateAt: 'toto', privacy: VideoPrivacy.PUBLIC } })
533
534 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
535 })
536
537 it('Should fail with an incorrect thumbnail file', async function () {
538 const fields = baseCorrectParams
539 const attaches = {
540 'thumbnailfile': join(__dirname, '..', '..', 'fixtures', 'avatar.png')
541 }
542
543 await makeUploadRequest({
544 url: server.url,
545 method: 'PUT',
546 path: path + videoId,
547 token: server.accessToken,
548 fields,
549 attaches
550 })
551 })
552
553 it('Should fail with a big thumbnail file', async function () {
554 const fields = baseCorrectParams
555 const attaches = {
556 'thumbnailfile': join(__dirname, '..', '..', 'fixtures', 'avatar-big.png')
557 }
558
559 await makeUploadRequest({
560 url: server.url,
561 method: 'PUT',
562 path: path + videoId,
563 token: server.accessToken,
564 fields,
565 attaches
566 })
567 })
568
569 it('Should fail with an incorrect preview file', async function () {
570 const fields = baseCorrectParams
571 const attaches = {
572 'previewfile': join(__dirname, '..', '..', 'fixtures', 'avatar.png')
573 }
574
575 await makeUploadRequest({
576 url: server.url,
577 method: 'PUT',
578 path: path + videoId,
579 token: server.accessToken,
580 fields,
581 attaches
582 })
583 })
584
585 it('Should fail with a big preview file', async function () {
586 const fields = baseCorrectParams
587 const attaches = {
588 'previewfile': join(__dirname, '..', '..', 'fixtures', 'avatar-big.png')
589 }
590
591 await makeUploadRequest({
592 url: server.url,
593 method: 'PUT',
594 path: path + videoId,
595 token: server.accessToken,
596 fields,
597 attaches
598 })
599 })
600
601 it('Should fail with a video of another user without the appropriate right', async function () {
602 const fields = baseCorrectParams
603
604 await makePutBodyRequest({ url: server.url, path: path + videoId, token: userAccessToken, fields, statusCodeExpected: 403 })
605 })
606
607 it('Should fail with a video of another server')
608
609 it('Should succeed with the correct parameters', async function () {
610 const fields = baseCorrectParams
611
612 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields, statusCodeExpected: 204 })
613 })
614 })
615
616 describe('When getting a video', function () {
617 it('Should return the list of the videos with nothing', async function () {
618 const res = await makeGetRequest({
619 url: server.url,
620 path,
621 statusCodeExpected: 200
622 })
623
624 expect(res.body.data).to.be.an('array')
625 expect(res.body.data.length).to.equal(3)
626 })
627
628 it('Should fail without a correct uuid', async function () {
629 await getVideo(server.url, 'coucou', 400)
630 })
631
632 it('Should return 404 with an incorrect video', async function () {
633 await getVideo(server.url, '4da6fde3-88f7-4d16-b119-108df5630b06', 404)
634 })
635
636 it('Should succeed with the correct parameters', async function () {
637 await getVideo(server.url, videoId)
638 })
639 })
640
641 describe('When rating a video', function () {
642 let videoId
643
644 before(async function () {
645 const res = await getVideosList(server.url)
646 videoId = res.body.data[0].id
647 })
648
649 it('Should fail without a valid uuid', async function () {
650 const fields = {
651 rating: 'like'
652 }
653 await makePutBodyRequest({ url: server.url, path: path + 'blabla/rate', token: server.accessToken, fields })
654 })
655
656 it('Should fail with an unknown id', async function () {
657 const fields = {
658 rating: 'like'
659 }
660 await makePutBodyRequest({
661 url: server.url,
662 path: path + '4da6fde3-88f7-4d16-b119-108df5630b06/rate',
663 token: server.accessToken,
664 fields,
665 statusCodeExpected: 404
666 })
667 })
668
669 it('Should fail with a wrong rating', async function () {
670 const fields = {
671 rating: 'likes'
672 }
673 await makePutBodyRequest({ url: server.url, path: path + videoId + '/rate', token: server.accessToken, fields })
674 })
675
676 it('Should succeed with the correct parameters', async function () {
677 const fields = {
678 rating: 'like'
679 }
680 await makePutBodyRequest({
681 url: server.url,
682 path: path + videoId + '/rate',
683 token: server.accessToken,
684 fields,
685 statusCodeExpected: 204
686 })
687 })
688 })
689
690 describe('When removing a video', function () {
691 it('Should have 404 with nothing', async function () {
692 await makeDeleteRequest({
693 url: server.url,
694 path,
695 statusCodeExpected: 400
696 })
697 })
698
699 it('Should fail without a correct uuid', async function () {
700 await removeVideo(server.url, server.accessToken, 'hello', 400)
701 })
702
703 it('Should fail with a video which does not exist', async function () {
704 await removeVideo(server.url, server.accessToken, '4da6fde3-88f7-4d16-b119-108df5630b06', 404)
705 })
706
707 it('Should fail with a video of another user without the appropriate right', async function () {
708 await removeVideo(server.url, userAccessToken, videoId, 403)
709 })
710
711 it('Should fail with a video of another server')
712
713 it('Should succeed with the correct parameters', async function () {
714 await removeVideo(server.url, server.accessToken, videoId)
715 })
716 })
717
718 after(async function () {
719 killallServers([ server ])
720
721 // Keep the logs if the test failed
722 if (this['ok']) {
723 await flushTests()
724 }
725 })
726 })