1 import * as request from 'supertest'
3 function changeVideoOwnership (url: string, token: string, videoId: number | string, username, expectedStatus = 204) {
4 const path = '/api/v1/videos/' + videoId + '/give-ownership'
8 .set('Accept', 'application/json')
9 .set('Authorization', 'Bearer ' + token)
11 .expect(expectedStatus)
14 function getVideoChangeOwnershipList (url: string, token: string) {
15 const path = '/api/v1/videos/ownership'
19 .query({ sort: '-createdAt' })
20 .set('Accept', 'application/json')
21 .set('Authorization', 'Bearer ' + token)
23 .expect('Content-Type', /json/)
26 function acceptChangeOwnership (url: string, token: string, ownershipId: string, channelId: number, expectedStatus = 204) {
27 const path = '/api/v1/videos/ownership/' + ownershipId + '/accept'
31 .set('Accept', 'application/json')
32 .set('Authorization', 'Bearer ' + token)
34 .expect(expectedStatus)
37 function refuseChangeOwnership (url: string, token: string, ownershipId: string, expectedStatus = 204) {
38 const path = '/api/v1/videos/ownership/' + ownershipId + '/refuse'
42 .set('Accept', 'application/json')
43 .set('Authorization', 'Bearer ' + token)
44 .expect(expectedStatus)
47 // ---------------------------------------------------------------------------
51 getVideoChangeOwnershipList,
52 acceptChangeOwnership,