]>
Commit | Line | Data |
---|---|---|
0e1dc3e7 | 1 | /* tslint:disable:no-unused-expression */ |
86d13ec2 | 2 | |
0e1dc3e7 | 3 | import * as chai from 'chai' |
afffe988 | 4 | import 'mocha' |
a76138ff | 5 | import { User, UserRole } from '../../../../shared/index' |
0e1dc3e7 | 6 | import { |
f8b8c36b C |
7 | createUser, flushTests, getBlacklistedVideosList, getMyUserInformation, getMyUserVideoQuotaUsed, getMyUserVideoRating, |
8 | getUserInformation, getUsersList, getUsersListPaginationAndSort, getVideosList, killallServers, login, makePutBodyRequest, rateVideo, | |
92b9d60c | 9 | registerUser, removeUser, removeVideo, runServer, ServerInfo, testImage, updateMyAvatar, updateMyUser, updateUser, uploadVideo, userLogin, |
d9eaee39 | 10 | deleteMe, blockUser, unblockUser, updateCustomSubConfig |
c5d31dba C |
11 | } from '../../utils/index' |
12 | import { follow } from '../../utils/server/follows' | |
c5d31dba | 13 | import { setAccessTokensToServers } from '../../utils/users/login' |
11ba2ab3 | 14 | import { getMyVideos } from '../../utils/videos/videos' |
0e1dc3e7 | 15 | |
afffe988 C |
16 | const expect = chai.expect |
17 | ||
0e1dc3e7 C |
18 | describe('Test users', function () { |
19 | let server: ServerInfo | |
20 | let accessToken: string | |
21 | let accessTokenUser: string | |
22 | let videoId: number | |
23 | let userId: number | |
f8b8c36b C |
24 | const user = { |
25 | username: 'user_1', | |
26 | password: 'super password' | |
27 | } | |
0e1dc3e7 C |
28 | |
29 | before(async function () { | |
e212f887 | 30 | this.timeout(30000) |
0e1dc3e7 C |
31 | |
32 | await flushTests() | |
33 | server = await runServer(1) | |
86d13ec2 C |
34 | |
35 | await setAccessTokensToServers([ server ]) | |
0e1dc3e7 C |
36 | }) |
37 | ||
38 | it('Should create a new client') | |
39 | ||
40 | it('Should return the first client') | |
41 | ||
42 | it('Should remove the last client') | |
43 | ||
44 | it('Should not login with an invalid client id', async function () { | |
45 | const client = { id: 'client', secret: server.client.secret } | |
46 | const res = await login(server.url, client, server.user, 400) | |
47 | ||
e6921918 | 48 | expect(res.body.error).to.contain('client is invalid') |
0e1dc3e7 C |
49 | }) |
50 | ||
51 | it('Should not login with an invalid client secret', async function () { | |
52 | const client = { id: server.client.id, secret: 'coucou' } | |
53 | const res = await login(server.url, client, server.user, 400) | |
54 | ||
e6921918 | 55 | expect(res.body.error).to.contain('client is invalid') |
0e1dc3e7 C |
56 | }) |
57 | ||
58 | it('Should not login with an invalid username', async function () { | |
59 | const user = { username: 'captain crochet', password: server.user.password } | |
60 | const res = await login(server.url, server.client, user, 400) | |
61 | ||
e6921918 | 62 | expect(res.body.error).to.contain('credentials are invalid') |
0e1dc3e7 C |
63 | }) |
64 | ||
65 | it('Should not login with an invalid password', async function () { | |
5f04dd2f | 66 | const user = { username: server.user.username, password: 'mew_three' } |
0e1dc3e7 C |
67 | const res = await login(server.url, server.client, user, 400) |
68 | ||
e6921918 | 69 | expect(res.body.error).to.contain('credentials are invalid') |
0e1dc3e7 C |
70 | }) |
71 | ||
72 | it('Should not be able to upload a video', async function () { | |
73 | accessToken = 'my_super_token' | |
74 | ||
75 | const videoAttributes = {} | |
76 | await uploadVideo(server.url, accessToken, videoAttributes, 401) | |
77 | }) | |
78 | ||
afffe988 | 79 | it('Should not be able to follow', async function () { |
0e1dc3e7 | 80 | accessToken = 'my_super_token' |
afffe988 | 81 | await follow(server.url, [ 'http://example.com' ], accessToken, 401) |
0e1dc3e7 C |
82 | }) |
83 | ||
afffe988 | 84 | it('Should not be able to unfollow') |
0e1dc3e7 C |
85 | |
86 | it('Should be able to login', async function () { | |
87 | const res = await login(server.url, server.client, server.user, 200) | |
88 | ||
89 | accessToken = res.body.access_token | |
90 | }) | |
91 | ||
92 | it('Should upload the video with the correct token', async function () { | |
93 | const videoAttributes = {} | |
04e0fc48 | 94 | await uploadVideo(server.url, accessToken, videoAttributes) |
0e1dc3e7 | 95 | const res = await getVideosList(server.url) |
afffe988 | 96 | const video = res.body.data[ 0 ] |
0e1dc3e7 | 97 | |
b64c950a | 98 | expect(video.account.name).to.equal('root') |
0e1dc3e7 C |
99 | videoId = video.id |
100 | }) | |
101 | ||
102 | it('Should upload the video again with the correct token', async function () { | |
103 | const videoAttributes = {} | |
04e0fc48 | 104 | await uploadVideo(server.url, accessToken, videoAttributes) |
0e1dc3e7 C |
105 | }) |
106 | ||
107 | it('Should retrieve a video rating', async function () { | |
108 | await rateVideo(server.url, accessToken, videoId, 'like') | |
26d21b78 | 109 | const res = await getMyUserVideoRating(server.url, accessToken, videoId) |
0e1dc3e7 C |
110 | const rating = res.body |
111 | ||
a7ba16b6 C |
112 | expect(rating.videoId).to.equal(videoId) |
113 | expect(rating.rating).to.equal('like') | |
0e1dc3e7 C |
114 | }) |
115 | ||
116 | it('Should not be able to remove the video with an incorrect token', async function () { | |
117 | await removeVideo(server.url, 'bad_token', videoId, 401) | |
118 | }) | |
119 | ||
120 | it('Should not be able to remove the video with the token of another account') | |
121 | ||
122 | it('Should be able to remove the video with the correct token', async function () { | |
123 | await removeVideo(server.url, accessToken, videoId) | |
124 | }) | |
125 | ||
126 | it('Should logout (revoke token)') | |
127 | ||
128 | it('Should not be able to get the user information') | |
129 | ||
130 | it('Should not be able to upload a video') | |
131 | ||
132 | it('Should not be able to remove a video') | |
133 | ||
134 | it('Should not be able to rate a video', async function () { | |
135 | const path = '/api/v1/videos/' | |
136 | const data = { | |
137 | rating: 'likes' | |
138 | } | |
139 | ||
140 | const options = { | |
141 | url: server.url, | |
142 | path: path + videoId, | |
143 | token: 'wrong token', | |
144 | fields: data, | |
145 | statusCodeExpected: 401 | |
146 | } | |
147 | await makePutBodyRequest(options) | |
148 | }) | |
149 | ||
150 | it('Should be able to login again') | |
151 | ||
152 | it('Should have an expired access token') | |
153 | ||
154 | it('Should refresh the token') | |
155 | ||
156 | it('Should be able to upload a video again') | |
157 | ||
158 | it('Should be able to create a new user', async function () { | |
f8b8c36b | 159 | await createUser(server.url, accessToken, user.username,user.password, 2 * 1024 * 1024) |
0e1dc3e7 C |
160 | }) |
161 | ||
162 | it('Should be able to login with this user', async function () { | |
f8b8c36b | 163 | accessTokenUser = await userLogin(server, user) |
0e1dc3e7 C |
164 | }) |
165 | ||
166 | it('Should be able to get the user information', async function () { | |
5c98d3bf | 167 | const res = await getMyUserInformation(server.url, accessTokenUser) |
0e1dc3e7 C |
168 | const user = res.body |
169 | ||
a7ba16b6 C |
170 | expect(user.username).to.equal('user_1') |
171 | expect(user.email).to.equal('user_1@example.com') | |
0883b324 | 172 | expect(user.nsfwPolicy).to.equal('display') |
a7ba16b6 C |
173 | expect(user.videoQuota).to.equal(2 * 1024 * 1024) |
174 | expect(user.roleLabel).to.equal('User') | |
175 | expect(user.id).to.be.a('number') | |
ed56ad11 | 176 | expect(user.account.displayName).to.equal('user_1') |
2422c46b | 177 | expect(user.account.description).to.be.null |
0e1dc3e7 C |
178 | }) |
179 | ||
180 | it('Should be able to upload a video with this user', async function () { | |
181 | this.timeout(5000) | |
182 | ||
11474c3c | 183 | const videoAttributes = { |
ce5496d6 C |
184 | name: 'super user video', |
185 | fixture: 'video_short.webm' | |
11474c3c | 186 | } |
0e1dc3e7 C |
187 | await uploadVideo(server.url, accessTokenUser, videoAttributes) |
188 | }) | |
189 | ||
ce5496d6 C |
190 | it('Should have video quota updated', async function () { |
191 | const res = await getMyUserVideoQuotaUsed(server.url, accessTokenUser) | |
192 | const data = res.body | |
193 | ||
194 | expect(data.videoQuotaUsed).to.equal(218910) | |
a76138ff C |
195 | |
196 | const resUsers = await getUsersList(server.url, server.accessToken) | |
197 | ||
198 | const users: User[] = resUsers.body.data | |
199 | const tmpUser = users.find(u => u.username === user.username) | |
200 | expect(tmpUser.videoQuotaUsed).to.equal(218910) | |
ce5496d6 C |
201 | }) |
202 | ||
11474c3c C |
203 | it('Should be able to list my videos', async function () { |
204 | const res = await getMyVideos(server.url, accessTokenUser, 0, 5) | |
a7ba16b6 | 205 | expect(res.body.total).to.equal(1) |
11474c3c C |
206 | |
207 | const videos = res.body.data | |
a7ba16b6 | 208 | expect(videos).to.have.lengthOf(1) |
11474c3c | 209 | |
a7ba16b6 | 210 | expect(videos[ 0 ].name).to.equal('super user video') |
11474c3c C |
211 | }) |
212 | ||
0e1dc3e7 | 213 | it('Should list all the users', async function () { |
86d13ec2 | 214 | const res = await getUsersList(server.url, server.accessToken) |
0e1dc3e7 C |
215 | const result = res.body |
216 | const total = result.total | |
217 | const users = result.data | |
218 | ||
a7ba16b6 C |
219 | expect(total).to.equal(2) |
220 | expect(users).to.be.an('array') | |
221 | expect(users.length).to.equal(2) | |
afffe988 C |
222 | |
223 | const user = users[ 0 ] | |
a7ba16b6 C |
224 | expect(user.username).to.equal('user_1') |
225 | expect(user.email).to.equal('user_1@example.com') | |
0883b324 | 226 | expect(user.nsfwPolicy).to.equal('display') |
0e1dc3e7 | 227 | |
afffe988 | 228 | const rootUser = users[ 1 ] |
a7ba16b6 C |
229 | expect(rootUser.username).to.equal('root') |
230 | expect(rootUser.email).to.equal('admin1@example.com') | |
0883b324 | 231 | expect(user.nsfwPolicy).to.equal('display') |
0e1dc3e7 C |
232 | |
233 | userId = user.id | |
234 | }) | |
235 | ||
236 | it('Should list only the first user by username asc', async function () { | |
86d13ec2 | 237 | const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 1, 'username') |
0e1dc3e7 C |
238 | |
239 | const result = res.body | |
240 | const total = result.total | |
241 | const users = result.data | |
242 | ||
a7ba16b6 C |
243 | expect(total).to.equal(2) |
244 | expect(users.length).to.equal(1) | |
afffe988 C |
245 | |
246 | const user = users[ 0 ] | |
a7ba16b6 C |
247 | expect(user.username).to.equal('root') |
248 | expect(user.email).to.equal('admin1@example.com') | |
249 | expect(user.roleLabel).to.equal('Administrator') | |
0883b324 | 250 | expect(user.nsfwPolicy).to.equal('display') |
0e1dc3e7 C |
251 | }) |
252 | ||
253 | it('Should list only the first user by username desc', async function () { | |
86d13ec2 | 254 | const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 1, '-username') |
0e1dc3e7 C |
255 | const result = res.body |
256 | const total = result.total | |
257 | const users = result.data | |
258 | ||
a7ba16b6 C |
259 | expect(total).to.equal(2) |
260 | expect(users.length).to.equal(1) | |
afffe988 C |
261 | |
262 | const user = users[ 0 ] | |
a7ba16b6 C |
263 | expect(user.username).to.equal('user_1') |
264 | expect(user.email).to.equal('user_1@example.com') | |
0883b324 | 265 | expect(user.nsfwPolicy).to.equal('display') |
0e1dc3e7 C |
266 | }) |
267 | ||
268 | it('Should list only the second user by createdAt desc', async function () { | |
86d13ec2 | 269 | const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 1, '-createdAt') |
0e1dc3e7 C |
270 | const result = res.body |
271 | const total = result.total | |
272 | const users = result.data | |
273 | ||
a7ba16b6 C |
274 | expect(total).to.equal(2) |
275 | expect(users.length).to.equal(1) | |
afffe988 C |
276 | |
277 | const user = users[ 0 ] | |
a7ba16b6 C |
278 | expect(user.username).to.equal('user_1') |
279 | expect(user.email).to.equal('user_1@example.com') | |
0883b324 | 280 | expect(user.nsfwPolicy).to.equal('display') |
0e1dc3e7 C |
281 | }) |
282 | ||
283 | it('Should list all the users by createdAt asc', async function () { | |
86d13ec2 | 284 | const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 2, 'createdAt') |
0e1dc3e7 C |
285 | const result = res.body |
286 | const total = result.total | |
287 | const users = result.data | |
288 | ||
a7ba16b6 C |
289 | expect(total).to.equal(2) |
290 | expect(users.length).to.equal(2) | |
291 | ||
292 | expect(users[ 0 ].username).to.equal('root') | |
293 | expect(users[ 0 ].email).to.equal('admin1@example.com') | |
0883b324 | 294 | expect(users[ 0 ].nsfwPolicy).to.equal('display') |
afffe988 | 295 | |
a7ba16b6 C |
296 | expect(users[ 1 ].username).to.equal('user_1') |
297 | expect(users[ 1 ].email).to.equal('user_1@example.com') | |
0883b324 | 298 | expect(users[ 1 ].nsfwPolicy).to.equal('display') |
0e1dc3e7 C |
299 | }) |
300 | ||
5c98d3bf | 301 | it('Should update my password', async function () { |
11ba2ab3 C |
302 | await updateMyUser({ |
303 | url: server.url, | |
304 | accessToken: accessTokenUser, | |
305 | newPassword: 'new password' | |
306 | }) | |
f8b8c36b | 307 | user.password = 'new password' |
0e1dc3e7 | 308 | |
f8b8c36b | 309 | await userLogin(server, user, 200) |
0e1dc3e7 C |
310 | }) |
311 | ||
312 | it('Should be able to change the NSFW display attribute', async function () { | |
11ba2ab3 C |
313 | await updateMyUser({ |
314 | url: server.url, | |
315 | accessToken: accessTokenUser, | |
0883b324 | 316 | nsfwPolicy: 'do_not_list' |
11ba2ab3 | 317 | }) |
0e1dc3e7 | 318 | |
5c98d3bf | 319 | const res = await getMyUserInformation(server.url, accessTokenUser) |
0e1dc3e7 C |
320 | const user = res.body |
321 | ||
a7ba16b6 C |
322 | expect(user.username).to.equal('user_1') |
323 | expect(user.email).to.equal('user_1@example.com') | |
0883b324 | 324 | expect(user.nsfwPolicy).to.equal('do_not_list') |
a7ba16b6 C |
325 | expect(user.videoQuota).to.equal(2 * 1024 * 1024) |
326 | expect(user.id).to.be.a('number') | |
ed56ad11 | 327 | expect(user.account.displayName).to.equal('user_1') |
2422c46b | 328 | expect(user.account.description).to.be.null |
5c98d3bf C |
329 | }) |
330 | ||
7efe153b | 331 | it('Should be able to change the autoPlayVideo attribute', async function () { |
11ba2ab3 C |
332 | await updateMyUser({ |
333 | url: server.url, | |
334 | accessToken: accessTokenUser, | |
335 | autoPlayVideo: false | |
336 | }) | |
7efe153b AL |
337 | |
338 | const res = await getMyUserInformation(server.url, accessTokenUser) | |
339 | const user = res.body | |
340 | ||
341 | expect(user.autoPlayVideo).to.be.false | |
342 | }) | |
343 | ||
5c98d3bf | 344 | it('Should be able to change the email display attribute', async function () { |
11ba2ab3 C |
345 | await updateMyUser({ |
346 | url: server.url, | |
347 | accessToken: accessTokenUser, | |
348 | email: 'updated@example.com' | |
349 | }) | |
5c98d3bf C |
350 | |
351 | const res = await getMyUserInformation(server.url, accessTokenUser) | |
352 | const user = res.body | |
353 | ||
a7ba16b6 C |
354 | expect(user.username).to.equal('user_1') |
355 | expect(user.email).to.equal('updated@example.com') | |
0883b324 | 356 | expect(user.nsfwPolicy).to.equal('do_not_list') |
a7ba16b6 C |
357 | expect(user.videoQuota).to.equal(2 * 1024 * 1024) |
358 | expect(user.id).to.be.a('number') | |
ed56ad11 | 359 | expect(user.account.displayName).to.equal('user_1') |
2422c46b | 360 | expect(user.account.description).to.be.null |
5c98d3bf C |
361 | }) |
362 | ||
c5911fd3 C |
363 | it('Should be able to update my avatar', async function () { |
364 | const fixture = 'avatar.png' | |
365 | ||
366 | await updateMyAvatar({ | |
367 | url: server.url, | |
368 | accessToken: accessTokenUser, | |
369 | fixture | |
370 | }) | |
371 | ||
372 | const res = await getMyUserInformation(server.url, accessTokenUser) | |
373 | const user = res.body | |
374 | ||
7b0956ec | 375 | await testImage(server.url, 'avatar-resized', user.account.avatar.path, '.png') |
c5911fd3 C |
376 | }) |
377 | ||
ed56ad11 C |
378 | it('Should be able to update my display name', async function () { |
379 | await updateMyUser({ | |
380 | url: server.url, | |
381 | accessToken: accessTokenUser, | |
382 | displayName: 'new display name' | |
383 | }) | |
384 | ||
385 | const res = await getMyUserInformation(server.url, accessTokenUser) | |
386 | const user = res.body | |
387 | ||
388 | expect(user.username).to.equal('user_1') | |
389 | expect(user.email).to.equal('updated@example.com') | |
390 | expect(user.nsfwPolicy).to.equal('do_not_list') | |
391 | expect(user.videoQuota).to.equal(2 * 1024 * 1024) | |
392 | expect(user.id).to.be.a('number') | |
393 | expect(user.account.displayName).to.equal('new display name') | |
394 | expect(user.account.description).to.be.null | |
395 | }) | |
396 | ||
2422c46b C |
397 | it('Should be able to update my description', async function () { |
398 | await updateMyUser({ | |
399 | url: server.url, | |
400 | accessToken: accessTokenUser, | |
401 | description: 'my super description updated' | |
402 | }) | |
403 | ||
404 | const res = await getMyUserInformation(server.url, accessTokenUser) | |
405 | const user = res.body | |
406 | ||
407 | expect(user.username).to.equal('user_1') | |
408 | expect(user.email).to.equal('updated@example.com') | |
0883b324 | 409 | expect(user.nsfwPolicy).to.equal('do_not_list') |
2422c46b C |
410 | expect(user.videoQuota).to.equal(2 * 1024 * 1024) |
411 | expect(user.id).to.be.a('number') | |
ed56ad11 | 412 | expect(user.account.displayName).to.equal('new display name') |
2422c46b C |
413 | expect(user.account.description).to.equal('my super description updated') |
414 | }) | |
415 | ||
5c98d3bf | 416 | it('Should be able to update another user', async function () { |
11ba2ab3 C |
417 | await updateUser({ |
418 | url: server.url, | |
419 | userId, | |
420 | accessToken, | |
421 | email: 'updated2@example.com', | |
422 | videoQuota: 42, | |
423 | role: UserRole.MODERATOR | |
424 | }) | |
5c98d3bf | 425 | |
77a5501f | 426 | const res = await getUserInformation(server.url, accessToken, userId) |
5c98d3bf C |
427 | const user = res.body |
428 | ||
a7ba16b6 C |
429 | expect(user.username).to.equal('user_1') |
430 | expect(user.email).to.equal('updated2@example.com') | |
0883b324 | 431 | expect(user.nsfwPolicy).to.equal('do_not_list') |
a7ba16b6 C |
432 | expect(user.videoQuota).to.equal(42) |
433 | expect(user.roleLabel).to.equal('Moderator') | |
434 | expect(user.id).to.be.a('number') | |
0e1dc3e7 C |
435 | }) |
436 | ||
f8b8c36b C |
437 | it('Should have removed the user token', async function () { |
438 | await getMyUserVideoQuotaUsed(server.url, accessTokenUser, 401) | |
439 | ||
440 | accessTokenUser = await userLogin(server, user) | |
441 | }) | |
442 | ||
757f0da3 C |
443 | it('Should not be able to delete a user by a moderator', async function () { |
444 | await removeUser(server.url, 2, accessTokenUser, 403) | |
445 | }) | |
446 | ||
447 | it('Should be able to list video blacklist by a moderator', async function () { | |
448 | await getBlacklistedVideosList(server.url, accessTokenUser) | |
449 | }) | |
450 | ||
0e1dc3e7 C |
451 | it('Should be able to remove this user', async function () { |
452 | await removeUser(server.url, userId, accessToken) | |
453 | }) | |
454 | ||
455 | it('Should not be able to login with this user', async function () { | |
f8b8c36b | 456 | await userLogin(server, user, 400) |
0e1dc3e7 C |
457 | }) |
458 | ||
459 | it('Should not have videos of this user', async function () { | |
460 | const res = await getVideosList(server.url) | |
461 | ||
a7ba16b6 | 462 | expect(res.body.total).to.equal(1) |
0e1dc3e7 | 463 | |
afffe988 | 464 | const video = res.body.data[ 0 ] |
b64c950a | 465 | expect(video.account.name).to.equal('root') |
0e1dc3e7 C |
466 | }) |
467 | ||
468 | it('Should register a new user', async function () { | |
469 | await registerUser(server.url, 'user_15', 'my super password') | |
470 | }) | |
471 | ||
472 | it('Should be able to login with this registered user', async function () { | |
f8b8c36b | 473 | const user15 = { |
0e1dc3e7 C |
474 | username: 'user_15', |
475 | password: 'my super password' | |
476 | } | |
477 | ||
f8b8c36b | 478 | accessToken = await userLogin(server, user15) |
5c98d3bf C |
479 | }) |
480 | ||
481 | it('Should have the correct video quota', async function () { | |
482 | const res = await getMyUserInformation(server.url, accessToken) | |
483 | const user = res.body | |
484 | ||
a7ba16b6 | 485 | expect(user.videoQuota).to.equal(5 * 1024 * 1024) |
0e1dc3e7 C |
486 | }) |
487 | ||
92b9d60c C |
488 | it('Should remove me', async function () { |
489 | { | |
490 | const res = await getUsersList(server.url, server.accessToken) | |
491 | expect(res.body.data.find(u => u.username === 'user_15')).to.not.be.undefined | |
492 | } | |
493 | ||
494 | await deleteMe(server.url, accessToken) | |
495 | ||
496 | { | |
497 | const res = await getUsersList(server.url, server.accessToken) | |
498 | expect(res.body.data.find(u => u.username === 'user_15')).to.be.undefined | |
499 | } | |
500 | }) | |
501 | ||
e6921918 C |
502 | it('Should block and unblock a user', async function () { |
503 | const user16 = { | |
504 | username: 'user_16', | |
505 | password: 'my super password' | |
506 | } | |
507 | const resUser = await createUser(server.url, server.accessToken, user16.username, user16.password) | |
508 | const user16Id = resUser.body.user.id | |
509 | ||
510 | accessToken = await userLogin(server, user16) | |
511 | ||
512 | await getMyUserInformation(server.url, accessToken, 200) | |
513 | await blockUser(server.url, user16Id, server.accessToken) | |
514 | ||
515 | await getMyUserInformation(server.url, accessToken, 401) | |
516 | await userLogin(server, user16, 400) | |
517 | ||
518 | await unblockUser(server.url, user16Id, server.accessToken) | |
519 | accessToken = await userLogin(server, user16) | |
520 | await getMyUserInformation(server.url, accessToken, 200) | |
521 | }) | |
522 | ||
0e1dc3e7 C |
523 | after(async function () { |
524 | killallServers([ server ]) | |
525 | ||
526 | // Keep the logs if the test failed | |
afffe988 | 527 | if (this[ 'ok' ]) { |
0e1dc3e7 C |
528 | await flushTests() |
529 | } | |
530 | }) | |
531 | }) |