3 const request
= require('supertest')
5 const videosAbuseUtils
= {
7 getVideoAbusesListPagination
,
8 getVideoAbusesListSort
,
12 // ---------------------- Export functions --------------------
14 function reportVideoAbuse (url
, token
, videoId
, reason
, specialStatus
, end
) {
20 const path
= '/api/v1/videos/' + videoId
+ '/abuse'
24 .set('Accept', 'application/json')
25 .set('Authorization', 'Bearer ' + token
)
27 .expect(specialStatus
)
31 function getVideoAbusesList (url
, token
, end
) {
32 const path
= '/api/v1/videos/abuse'
36 .query({ sort: 'createdAt' })
37 .set('Accept', 'application/json')
38 .set('Authorization', 'Bearer ' + token
)
40 .expect('Content-Type', /json/)
44 function getVideoAbusesListPagination (url
, token
, start
, count
, end
) {
45 const path
= '/api/v1/videos/abuse'
49 .query({ start: start
})
50 .query({ count: count
})
51 .set('Accept', 'application/json')
52 .set('Authorization', 'Bearer ' + token
)
54 .expect('Content-Type', /json/)
58 function getVideoAbusesListSort (url
, token
, sort
, end
) {
59 const path
= '/api/v1/videos/abuse'
63 .query({ sort: sort
})
64 .set('Accept', 'application/json')
65 .set('Authorization', 'Bearer ' + token
)
67 .expect('Content-Type', /json/)
71 // ---------------------------------------------------------------------------
73 module
.exports
= videosAbuseUtils