aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/requests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-07 10:36:13 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-04-08 10:07:53 +0200
commit213e30ef90806369529684ac9c247d73b8dc7928 (patch)
tree7f834f2485a074b1d3052745fa5236d34c0f26db /shared/extra-utils/requests
parent2cb03dc1f4e01ba491c36caff30c33fe9c5bad89 (diff)
downloadPeerTube-213e30ef90806369529684ac9c247d73b8dc7928.tar.gz
PeerTube-213e30ef90806369529684ac9c247d73b8dc7928.tar.zst
PeerTube-213e30ef90806369529684ac9c247d73b8dc7928.zip
Add banner tests
Diffstat (limited to 'shared/extra-utils/requests')
-rw-r--r--shared/extra-utils/requests/requests.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/shared/extra-utils/requests/requests.ts b/shared/extra-utils/requests/requests.ts
index 3e773ee03..8b5cddf4a 100644
--- a/shared/extra-utils/requests/requests.ts
+++ b/shared/extra-utils/requests/requests.ts
@@ -152,11 +152,12 @@ function makeHTMLRequest (url: string, path: string) {
152 .expect(HttpStatusCode.OK_200) 152 .expect(HttpStatusCode.OK_200)
153} 153}
154 154
155function updateAvatarRequest (options: { 155function updateImageRequest (options: {
156 url: string 156 url: string
157 path: string 157 path: string
158 accessToken: string 158 accessToken: string
159 fixture: string 159 fixture: string
160 fieldname: string
160}) { 161}) {
161 let filePath = '' 162 let filePath = ''
162 if (isAbsolute(options.fixture)) { 163 if (isAbsolute(options.fixture)) {
@@ -170,7 +171,7 @@ function updateAvatarRequest (options: {
170 path: options.path, 171 path: options.path,
171 token: options.accessToken, 172 token: options.accessToken,
172 fields: {}, 173 fields: {},
173 attaches: { avatarfile: filePath }, 174 attaches: { [options.fieldname]: filePath },
174 statusCodeExpected: HttpStatusCode.OK_200 175 statusCodeExpected: HttpStatusCode.OK_200
175 }) 176 })
176} 177}
@@ -191,5 +192,5 @@ export {
191 makePutBodyRequest, 192 makePutBodyRequest,
192 makeDeleteRequest, 193 makeDeleteRequest,
193 makeRawRequest, 194 makeRawRequest,
194 updateAvatarRequest 195 updateImageRequest
195} 196}