aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-12-11 11:06:32 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-12-11 11:06:32 +0100
commitfada8d75550dc7365f7e18ee1569b9406251d660 (patch)
treedb9dc01c18693824f83fce5020f4c1f3ae7c0865 /server/tests/utils/videos.ts
parent492fd28167f770d79a430fc57451b5a9e075d8e7 (diff)
parentc2830fa8f84f61462098bf36add824f89436dfa9 (diff)
downloadPeerTube-fada8d75550dc7365f7e18ee1569b9406251d660.tar.gz
PeerTube-fada8d75550dc7365f7e18ee1569b9406251d660.tar.zst
PeerTube-fada8d75550dc7365f7e18ee1569b9406251d660.zip
Merge branch 'feature/design' into develop
Diffstat (limited to 'server/tests/utils/videos.ts')
-rw-r--r--server/tests/utils/videos.ts22
1 files changed, 11 insertions, 11 deletions
diff --git a/server/tests/utils/videos.ts b/server/tests/utils/videos.ts
index 73a9f1a0a..fb758cf29 100644
--- a/server/tests/utils/videos.ts
+++ b/server/tests/utils/videos.ts
@@ -145,26 +145,25 @@ function removeVideo (url: string, token: string, id: number, expectedStatus = 2
145 .expect(expectedStatus) 145 .expect(expectedStatus)
146} 146}
147 147
148function searchVideo (url: string, search: string, field?: string) { 148function searchVideo (url: string, search: string) {
149 const path = '/api/v1/videos' 149 const path = '/api/v1/videos'
150 const req = request(url) 150 const req = request(url)
151 .get(path + '/search/' + search) 151 .get(path + '/search')
152 .set('Accept', 'application/json') 152 .query({ search })
153 153 .set('Accept', 'application/json')
154 if (field) req.query({ field })
155 154
156 return req.expect(200) 155 return req.expect(200)
157 .expect('Content-Type', /json/) 156 .expect('Content-Type', /json/)
158} 157}
159 158
160function searchVideoWithPagination (url: string, search: string, field: string, start: number, count: number, sort?: string) { 159function searchVideoWithPagination (url: string, search: string, start: number, count: number, sort?: string) {
161 const path = '/api/v1/videos' 160 const path = '/api/v1/videos'
162 161
163 const req = request(url) 162 const req = request(url)
164 .get(path + '/search/' + search) 163 .get(path + '/search')
165 .query({ start }) 164 .query({ start })
165 .query({ search })
166 .query({ count }) 166 .query({ count })
167 .query({ field })
168 167
169 if (sort) req.query({ sort }) 168 if (sort) req.query({ sort })
170 169
@@ -177,7 +176,8 @@ function searchVideoWithSort (url: string, search: string, sort: string) {
177 const path = '/api/v1/videos' 176 const path = '/api/v1/videos'
178 177
179 return request(url) 178 return request(url)
180 .get(path + '/search/' + search) 179 .get(path + '/search')
180 .query({ search })
181 .query({ sort }) 181 .query({ sort })
182 .set('Accept', 'application/json') 182 .set('Accept', 'application/json')
183 .expect(200) 183 .expect(200)
@@ -201,7 +201,7 @@ async function testVideoImage (url: string, imageName: string, imagePath: string
201 } 201 }
202} 202}
203 203
204async function uploadVideo (url: string, accessToken: string, videoAttributesArg: VideoAttributes, specialStatus = 204) { 204async function uploadVideo (url: string, accessToken: string, videoAttributesArg: VideoAttributes, specialStatus = 200) {
205 const path = '/api/v1/videos/upload' 205 const path = '/api/v1/videos/upload'
206 let defaultChannelId = '1' 206 let defaultChannelId = '1'
207 207