aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/users/users.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/utils/users/users.ts')
-rw-r--r--server/tests/utils/users/users.ts18
1 files changed, 2 insertions, 16 deletions
diff --git a/server/tests/utils/users/users.ts b/server/tests/utils/users/users.ts
index 34d50f7ad..37b15f64a 100644
--- a/server/tests/utils/users/users.ts
+++ b/server/tests/utils/users/users.ts
@@ -1,6 +1,5 @@
1import { isAbsolute, join } from 'path'
2import * as request from 'supertest' 1import * as request from 'supertest'
3import { makePostBodyRequest, makeUploadRequest, makePutBodyRequest } from '../' 2import { makePostBodyRequest, makePutBodyRequest, updateAvatarRequest } from '../'
4 3
5import { UserRole } from '../../../../shared/index' 4import { UserRole } from '../../../../shared/index'
6import { NSFWPolicyType } from '../../../../shared/models/videos/nsfw-policy.type' 5import { NSFWPolicyType } from '../../../../shared/models/videos/nsfw-policy.type'
@@ -160,21 +159,8 @@ function updateMyAvatar (options: {
160 fixture: string 159 fixture: string
161}) { 160}) {
162 const path = '/api/v1/users/me/avatar/pick' 161 const path = '/api/v1/users/me/avatar/pick'
163 let filePath = ''
164 if (isAbsolute(options.fixture)) {
165 filePath = options.fixture
166 } else {
167 filePath = join(__dirname, '..', '..', 'fixtures', options.fixture)
168 }
169 162
170 return makeUploadRequest({ 163 return updateAvatarRequest(Object.assign(options, { path }))
171 url: options.url,
172 path,
173 token: options.accessToken,
174 fields: {},
175 attaches: { avatarfile: filePath },
176 statusCodeExpected: 200
177 })
178} 164}
179 165
180function updateUser (options: { 166function updateUser (options: {