aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-23 18:04:48 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:53 +0100
commitd4f1e94c89336255537b0b82913591f00e716201 (patch)
treec7d18e09a4f53eafc61de8cb0692c020b197512d /server/tests
parent8d468a16fd33ec2660c3c59b3f7def53eb0cc4a1 (diff)
downloadPeerTube-d4f1e94c89336255537b0b82913591f00e716201.tar.gz
PeerTube-d4f1e94c89336255537b0b82913591f00e716201.tar.zst
PeerTube-d4f1e94c89336255537b0b82913591f00e716201.zip
Misc cleanup
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/utils/video-abuses.ts29
-rw-r--r--server/tests/utils/videos.ts14
2 files changed, 1 insertions, 42 deletions
diff --git a/server/tests/utils/video-abuses.ts b/server/tests/utils/video-abuses.ts
index f7ee958d7..f00809234 100644
--- a/server/tests/utils/video-abuses.ts
+++ b/server/tests/utils/video-abuses.ts
@@ -23,36 +23,9 @@ function getVideoAbusesList (url: string, token: string) {
23 .expect('Content-Type', /json/) 23 .expect('Content-Type', /json/)
24} 24}
25 25
26function getVideoAbusesListPagination (url: string, token: string, start: number, count: number) {
27 const path = '/api/v1/videos/abuse'
28
29 return request(url)
30 .get(path)
31 .query({ start: start })
32 .query({ count: count })
33 .set('Accept', 'application/json')
34 .set('Authorization', 'Bearer ' + token)
35 .expect(200)
36 .expect('Content-Type', /json/)
37}
38
39function getVideoAbusesListSort (url: string, token: string, sort: string) {
40 const path = '/api/v1/videos/abuse'
41
42 return request(url)
43 .get(path)
44 .query({ sort: sort })
45 .set('Accept', 'application/json')
46 .set('Authorization', 'Bearer ' + token)
47 .expect(200)
48 .expect('Content-Type', /json/)
49}
50
51// --------------------------------------------------------------------------- 26// ---------------------------------------------------------------------------
52 27
53export { 28export {
54 reportVideoAbuse, 29 reportVideoAbuse,
55 getVideoAbusesList, 30 getVideoAbusesList
56 getVideoAbusesListPagination,
57 getVideoAbusesListSort
58} 31}
diff --git a/server/tests/utils/videos.ts b/server/tests/utils/videos.ts
index d4d5faf0a..dababe924 100644
--- a/server/tests/utils/videos.ts
+++ b/server/tests/utils/videos.ts
@@ -46,19 +46,6 @@ function getVideoPrivacies (url: string) {
46 return makeGetRequest(url, path) 46 return makeGetRequest(url, path)
47} 47}
48 48
49function getAllVideosListBy (url: string) {
50 const path = '/api/v1/videos'
51
52 return request(url)
53 .get(path)
54 .query({ sort: 'createdAt' })
55 .query({ start: 0 })
56 .query({ count: 10000 })
57 .set('Accept', 'application/json')
58 .expect(200)
59 .expect('Content-Type', /json/)
60}
61
62function getVideo (url: string, id: number | string, expectedStatus = 200) { 49function getVideo (url: string, id: number | string, expectedStatus = 200) {
63 const path = '/api/v1/videos/' + id 50 const path = '/api/v1/videos/' + id
64 51
@@ -312,7 +299,6 @@ export {
312 getVideoLicences, 299 getVideoLicences,
313 getVideoPrivacies, 300 getVideoPrivacies,
314 getVideoLanguages, 301 getVideoLanguages,
315 getAllVideosListBy,
316 getMyVideos, 302 getMyVideos,
317 getVideo, 303 getVideo,
318 getVideoWithToken, 304 getVideoWithToken,