]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/api/users/users.ts
Merge branch 'release/2.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / users / users.ts
1 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2
3 import * as chai from 'chai'
4 import 'mocha'
5 import { MyUser, User, UserRole, Video, VideoPlaylistType } from '../../../../shared/index'
6 import {
7 blockUser,
8 cleanupTests,
9 createUser,
10 deleteMe,
11 flushAndRunServer,
12 getAccountRatings,
13 getBlacklistedVideosList,
14 getMyUserInformation,
15 getMyUserVideoQuotaUsed,
16 getMyUserVideoRating,
17 getUserInformation,
18 getUsersList,
19 getUsersListPaginationAndSort,
20 getVideoChannel,
21 getVideosList,
22 installPlugin,
23 login,
24 makePutBodyRequest,
25 rateVideo,
26 registerUserWithChannel,
27 removeUser,
28 removeVideo,
29 ServerInfo,
30 testImage,
31 unblockUser,
32 updateMyAvatar,
33 updateMyUser,
34 updateUser,
35 uploadVideo,
36 userLogin
37 } from '../../../../shared/extra-utils'
38 import { follow } from '../../../../shared/extra-utils/server/follows'
39 import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login'
40 import { getMyVideos } from '../../../../shared/extra-utils/videos/videos'
41 import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
42
43 const expect = chai.expect
44
45 describe('Test users', function () {
46 let server: ServerInfo
47 let accessToken: string
48 let accessTokenUser: string
49 let videoId: number
50 let userId: number
51 const user = {
52 username: 'user_1',
53 password: 'super password'
54 }
55
56 before(async function () {
57 this.timeout(30000)
58 server = await flushAndRunServer(1)
59
60 await setAccessTokensToServers([ server ])
61
62 await installPlugin({ url: server.url, accessToken: server.accessToken, npmName: 'peertube-theme-background-red' })
63 })
64
65 describe('OAuth client', function () {
66 it('Should create a new client')
67
68 it('Should return the first client')
69
70 it('Should remove the last client')
71
72 it('Should not login with an invalid client id', async function () {
73 const client = { id: 'client', secret: server.client.secret }
74 const res = await login(server.url, client, server.user, 400)
75
76 expect(res.body.error).to.contain('client is invalid')
77 })
78
79 it('Should not login with an invalid client secret', async function () {
80 const client = { id: server.client.id, secret: 'coucou' }
81 const res = await login(server.url, client, server.user, 400)
82
83 expect(res.body.error).to.contain('client is invalid')
84 })
85 })
86
87 describe('Login', function () {
88
89 it('Should not login with an invalid username', async function () {
90 const user = { username: 'captain crochet', password: server.user.password }
91 const res = await login(server.url, server.client, user, 400)
92
93 expect(res.body.error).to.contain('credentials are invalid')
94 })
95
96 it('Should not login with an invalid password', async function () {
97 const user = { username: server.user.username, password: 'mew_three' }
98 const res = await login(server.url, server.client, user, 400)
99
100 expect(res.body.error).to.contain('credentials are invalid')
101 })
102
103 it('Should not be able to upload a video', async function () {
104 accessToken = 'my_super_token'
105
106 const videoAttributes = {}
107 await uploadVideo(server.url, accessToken, videoAttributes, 401)
108 })
109
110 it('Should not be able to follow', async function () {
111 accessToken = 'my_super_token'
112 await follow(server.url, [ 'http://example.com' ], accessToken, 401)
113 })
114
115 it('Should not be able to unfollow')
116
117 it('Should be able to login', async function () {
118 const res = await login(server.url, server.client, server.user, 200)
119
120 accessToken = res.body.access_token
121 })
122
123 it('Should be able to login with an insensitive username', async function () {
124 const user = { username: 'RoOt', password: server.user.password }
125 await login(server.url, server.client, user, 200)
126
127 const user2 = { username: 'rOoT', password: server.user.password }
128 await login(server.url, server.client, user2, 200)
129
130 const user3 = { username: 'ROOt', password: server.user.password }
131 await login(server.url, server.client, user3, 200)
132 })
133 })
134
135 describe('Upload', function () {
136
137 it('Should upload the video with the correct token', async function () {
138 const videoAttributes = {}
139 await uploadVideo(server.url, accessToken, videoAttributes)
140 const res = await getVideosList(server.url)
141 const video = res.body.data[0]
142
143 expect(video.account.name).to.equal('root')
144 videoId = video.id
145 })
146
147 it('Should upload the video again with the correct token', async function () {
148 const videoAttributes = {}
149 await uploadVideo(server.url, accessToken, videoAttributes)
150 })
151 })
152
153 describe('Ratings', function () {
154
155 it('Should retrieve a video rating', async function () {
156 await rateVideo(server.url, accessToken, videoId, 'like')
157 const res = await getMyUserVideoRating(server.url, accessToken, videoId)
158 const rating = res.body
159
160 expect(rating.videoId).to.equal(videoId)
161 expect(rating.rating).to.equal('like')
162 })
163
164 it('Should retrieve ratings list', async function () {
165 await rateVideo(server.url, accessToken, videoId, 'like')
166
167 const res = await getAccountRatings(server.url, server.user.username, server.accessToken, null, 200)
168 const ratings = res.body
169
170 expect(ratings.total).to.equal(1)
171 expect(ratings.data[0].video.id).to.equal(videoId)
172 expect(ratings.data[0].rating).to.equal('like')
173 })
174
175 it('Should retrieve ratings list by rating type', async function () {
176 {
177 const res = await getAccountRatings(server.url, server.user.username, server.accessToken, 'like')
178 const ratings = res.body
179 expect(ratings.data.length).to.equal(1)
180 }
181
182 {
183 const res = await getAccountRatings(server.url, server.user.username, server.accessToken, 'dislike')
184 const ratings = res.body
185 expect(ratings.data.length).to.equal(0)
186 }
187 })
188 })
189
190 describe('Remove video', function () {
191 it('Should not be able to remove the video with an incorrect token', async function () {
192 await removeVideo(server.url, 'bad_token', videoId, 401)
193 })
194
195 it('Should not be able to remove the video with the token of another account')
196
197 it('Should be able to remove the video with the correct token', async function () {
198 await removeVideo(server.url, accessToken, videoId)
199 })
200 })
201
202 describe('Logout', function () {
203 it('Should logout (revoke token)')
204
205 it('Should not be able to get the user information')
206
207 it('Should not be able to upload a video')
208
209 it('Should not be able to remove a video')
210
211 it('Should not be able to rate a video', async function () {
212 const path = '/api/v1/videos/'
213 const data = {
214 rating: 'likes'
215 }
216
217 const options = {
218 url: server.url,
219 path: path + videoId,
220 token: 'wrong token',
221 fields: data,
222 statusCodeExpected: 401
223 }
224 await makePutBodyRequest(options)
225 })
226
227 it('Should be able to login again')
228
229 it('Should have an expired access token')
230
231 it('Should refresh the token')
232
233 it('Should be able to upload a video again')
234 })
235
236 describe('Creating a user', function () {
237
238 it('Should be able to create a new user', async function () {
239 await createUser({
240 url: server.url,
241 accessToken: accessToken,
242 username: user.username,
243 password: user.password,
244 videoQuota: 2 * 1024 * 1024,
245 adminFlags: UserAdminFlag.BY_PASS_VIDEO_AUTO_BLACKLIST
246 })
247 })
248
249 it('Should be able to login with this user', async function () {
250 accessTokenUser = await userLogin(server, user)
251 })
252
253 it('Should be able to get user information', async function () {
254 const res1 = await getMyUserInformation(server.url, accessTokenUser)
255 const userMe: MyUser = res1.body
256
257 const res2 = await getUserInformation(server.url, server.accessToken, userMe.id)
258 const userGet: User = res2.body
259
260 for (const user of [ userMe, userGet ]) {
261 expect(user.username).to.equal('user_1')
262 expect(user.email).to.equal('user_1@example.com')
263 expect(user.nsfwPolicy).to.equal('display')
264 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
265 expect(user.roleLabel).to.equal('User')
266 expect(user.id).to.be.a('number')
267 expect(user.account.displayName).to.equal('user_1')
268 expect(user.account.description).to.be.null
269 }
270
271 expect(userMe.adminFlags).to.be.undefined
272 expect(userGet.adminFlags).to.equal(UserAdminFlag.BY_PASS_VIDEO_AUTO_BLACKLIST)
273
274 expect(userMe.specialPlaylists).to.have.lengthOf(1)
275 expect(userMe.specialPlaylists[0].type).to.equal(VideoPlaylistType.WATCH_LATER)
276 })
277 })
278
279 describe('My videos & quotas', function () {
280
281 it('Should be able to upload a video with this user', async function () {
282 this.timeout(5000)
283
284 const videoAttributes = {
285 name: 'super user video',
286 fixture: 'video_short.webm'
287 }
288 await uploadVideo(server.url, accessTokenUser, videoAttributes)
289 })
290
291 it('Should have video quota updated', async function () {
292 const res = await getMyUserVideoQuotaUsed(server.url, accessTokenUser)
293 const data = res.body
294
295 expect(data.videoQuotaUsed).to.equal(218910)
296
297 const resUsers = await getUsersList(server.url, server.accessToken)
298
299 const users: User[] = resUsers.body.data
300 const tmpUser = users.find(u => u.username === user.username)
301 expect(tmpUser.videoQuotaUsed).to.equal(218910)
302 })
303
304 it('Should be able to list my videos', async function () {
305 const res = await getMyVideos(server.url, accessTokenUser, 0, 5)
306 expect(res.body.total).to.equal(1)
307
308 const videos = res.body.data
309 expect(videos).to.have.lengthOf(1)
310
311 const video: Video = videos[0]
312 expect(video.name).to.equal('super user video')
313 expect(video.thumbnailPath).to.not.be.null
314 expect(video.previewPath).to.not.be.null
315 })
316
317 it('Should be able to search in my videos', async function () {
318 {
319 const res = await getMyVideos(server.url, accessTokenUser, 0, 5, '-createdAt', 'user video')
320 expect(res.body.total).to.equal(1)
321
322 const videos = res.body.data
323 expect(videos).to.have.lengthOf(1)
324 }
325
326 {
327 const res = await getMyVideos(server.url, accessTokenUser, 0, 5, '-createdAt', 'toto')
328 expect(res.body.total).to.equal(0)
329
330 const videos = res.body.data
331 expect(videos).to.have.lengthOf(0)
332 }
333 })
334 })
335
336 describe('Users listing', function () {
337
338 it('Should list all the users', async function () {
339 const res = await getUsersList(server.url, server.accessToken)
340 const result = res.body
341 const total = result.total
342 const users = result.data
343
344 expect(total).to.equal(2)
345 expect(users).to.be.an('array')
346 expect(users.length).to.equal(2)
347
348 const user = users[0]
349 expect(user.username).to.equal('user_1')
350 expect(user.email).to.equal('user_1@example.com')
351 expect(user.nsfwPolicy).to.equal('display')
352
353 const rootUser = users[1]
354 expect(rootUser.username).to.equal('root')
355 expect(rootUser.email).to.equal('admin' + server.internalServerNumber + '@example.com')
356 expect(user.nsfwPolicy).to.equal('display')
357
358 userId = user.id
359 })
360
361 it('Should list only the first user by username asc', async function () {
362 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 1, 'username')
363
364 const result = res.body
365 const total = result.total
366 const users = result.data
367
368 expect(total).to.equal(2)
369 expect(users.length).to.equal(1)
370
371 const user = users[0]
372 expect(user.username).to.equal('root')
373 expect(user.email).to.equal('admin' + server.internalServerNumber + '@example.com')
374 expect(user.roleLabel).to.equal('Administrator')
375 expect(user.nsfwPolicy).to.equal('display')
376 })
377
378 it('Should list only the first user by username desc', async function () {
379 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 1, '-username')
380 const result = res.body
381 const total = result.total
382 const users = result.data
383
384 expect(total).to.equal(2)
385 expect(users.length).to.equal(1)
386
387 const user = users[0]
388 expect(user.username).to.equal('user_1')
389 expect(user.email).to.equal('user_1@example.com')
390 expect(user.nsfwPolicy).to.equal('display')
391 })
392
393 it('Should list only the second user by createdAt desc', async function () {
394 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 1, '-createdAt')
395 const result = res.body
396 const total = result.total
397 const users = result.data
398
399 expect(total).to.equal(2)
400 expect(users.length).to.equal(1)
401
402 const user = users[0]
403 expect(user.username).to.equal('user_1')
404 expect(user.email).to.equal('user_1@example.com')
405 expect(user.nsfwPolicy).to.equal('display')
406 })
407
408 it('Should list all the users by createdAt asc', async function () {
409 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 2, 'createdAt')
410 const result = res.body
411 const total = result.total
412 const users = result.data
413
414 expect(total).to.equal(2)
415 expect(users.length).to.equal(2)
416
417 expect(users[0].username).to.equal('root')
418 expect(users[0].email).to.equal('admin' + server.internalServerNumber + '@example.com')
419 expect(users[0].nsfwPolicy).to.equal('display')
420
421 expect(users[1].username).to.equal('user_1')
422 expect(users[1].email).to.equal('user_1@example.com')
423 expect(users[1].nsfwPolicy).to.equal('display')
424 })
425
426 it('Should search user by username', async function () {
427 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 2, 'createdAt', 'oot')
428 const users = res.body.data as User[]
429
430 expect(res.body.total).to.equal(1)
431 expect(users.length).to.equal(1)
432
433 expect(users[0].username).to.equal('root')
434 })
435
436 it('Should search user by email', async function () {
437 {
438 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 2, 'createdAt', 'r_1@exam')
439 const users = res.body.data as User[]
440
441 expect(res.body.total).to.equal(1)
442 expect(users.length).to.equal(1)
443
444 expect(users[0].username).to.equal('user_1')
445 expect(users[0].email).to.equal('user_1@example.com')
446 }
447
448 {
449 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 2, 'createdAt', 'example')
450 const users = res.body.data as User[]
451
452 expect(res.body.total).to.equal(2)
453 expect(users.length).to.equal(2)
454
455 expect(users[0].username).to.equal('root')
456 expect(users[1].username).to.equal('user_1')
457 }
458 })
459 })
460
461 describe('Update my account', function () {
462 it('Should update my password', async function () {
463 await updateMyUser({
464 url: server.url,
465 accessToken: accessTokenUser,
466 currentPassword: 'super password',
467 password: 'new password'
468 })
469 user.password = 'new password'
470
471 await userLogin(server, user, 200)
472 })
473
474 it('Should be able to change the NSFW display attribute', async function () {
475 await updateMyUser({
476 url: server.url,
477 accessToken: accessTokenUser,
478 nsfwPolicy: 'do_not_list'
479 })
480
481 const res = await getMyUserInformation(server.url, accessTokenUser)
482 const user = res.body
483
484 expect(user.username).to.equal('user_1')
485 expect(user.email).to.equal('user_1@example.com')
486 expect(user.nsfwPolicy).to.equal('do_not_list')
487 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
488 expect(user.id).to.be.a('number')
489 expect(user.account.displayName).to.equal('user_1')
490 expect(user.account.description).to.be.null
491 })
492
493 it('Should be able to change the autoPlayVideo attribute', async function () {
494 await updateMyUser({
495 url: server.url,
496 accessToken: accessTokenUser,
497 autoPlayVideo: false
498 })
499
500 const res = await getMyUserInformation(server.url, accessTokenUser)
501 const user = res.body
502
503 expect(user.autoPlayVideo).to.be.false
504 })
505
506 it('Should be able to change the autoPlayNextVideo attribute', async function () {
507 await updateMyUser({
508 url: server.url,
509 accessToken: accessTokenUser,
510 autoPlayNextVideo: true
511 })
512
513 const res = await getMyUserInformation(server.url, accessTokenUser)
514 const user = res.body
515
516 expect(user.autoPlayNextVideo).to.be.true
517 })
518
519 it('Should be able to change the email attribute', async function () {
520 await updateMyUser({
521 url: server.url,
522 accessToken: accessTokenUser,
523 currentPassword: 'new password',
524 email: 'updated@example.com'
525 })
526
527 const res = await getMyUserInformation(server.url, accessTokenUser)
528 const user = res.body
529
530 expect(user.username).to.equal('user_1')
531 expect(user.email).to.equal('updated@example.com')
532 expect(user.nsfwPolicy).to.equal('do_not_list')
533 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
534 expect(user.id).to.be.a('number')
535 expect(user.account.displayName).to.equal('user_1')
536 expect(user.account.description).to.be.null
537 })
538
539 it('Should be able to update my avatar', async function () {
540 const fixture = 'avatar.png'
541
542 await updateMyAvatar({
543 url: server.url,
544 accessToken: accessTokenUser,
545 fixture
546 })
547
548 const res = await getMyUserInformation(server.url, accessTokenUser)
549 const user = res.body
550
551 await testImage(server.url, 'avatar-resized', user.account.avatar.path, '.png')
552 })
553
554 it('Should be able to update my display name', async function () {
555 await updateMyUser({
556 url: server.url,
557 accessToken: accessTokenUser,
558 displayName: 'new display name'
559 })
560
561 const res = await getMyUserInformation(server.url, accessTokenUser)
562 const user = res.body
563
564 expect(user.username).to.equal('user_1')
565 expect(user.email).to.equal('updated@example.com')
566 expect(user.nsfwPolicy).to.equal('do_not_list')
567 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
568 expect(user.id).to.be.a('number')
569 expect(user.account.displayName).to.equal('new display name')
570 expect(user.account.description).to.be.null
571 })
572
573 it('Should be able to update my description', async function () {
574 await updateMyUser({
575 url: server.url,
576 accessToken: accessTokenUser,
577 description: 'my super description updated'
578 })
579
580 const res = await getMyUserInformation(server.url, accessTokenUser)
581 const user: User = res.body
582
583 expect(user.username).to.equal('user_1')
584 expect(user.email).to.equal('updated@example.com')
585 expect(user.nsfwPolicy).to.equal('do_not_list')
586 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
587 expect(user.id).to.be.a('number')
588 expect(user.account.displayName).to.equal('new display name')
589 expect(user.account.description).to.equal('my super description updated')
590 expect(user.noWelcomeModal).to.be.false
591 expect(user.noInstanceConfigWarningModal).to.be.false
592 })
593
594 it('Should be able to update my theme', async function () {
595 for (const theme of [ 'background-red', 'default', 'instance-default' ]) {
596 await updateMyUser({
597 url: server.url,
598 accessToken: accessTokenUser,
599 theme
600 })
601
602 const res = await getMyUserInformation(server.url, accessTokenUser)
603 const body: User = res.body
604
605 expect(body.theme).to.equal(theme)
606 }
607 })
608
609 it('Should be able to update my modal preferences', async function () {
610 await updateMyUser({
611 url: server.url,
612 accessToken: accessTokenUser,
613 noInstanceConfigWarningModal: true,
614 noWelcomeModal: true
615 })
616
617 const res = await getMyUserInformation(server.url, accessTokenUser)
618 const user: User = res.body
619
620 expect(user.noWelcomeModal).to.be.true
621 expect(user.noInstanceConfigWarningModal).to.be.true
622 })
623 })
624
625 describe('Updating another user', function () {
626
627 it('Should be able to update another user', async function () {
628 await updateUser({
629 url: server.url,
630 userId,
631 accessToken,
632 email: 'updated2@example.com',
633 emailVerified: true,
634 videoQuota: 42,
635 role: UserRole.MODERATOR,
636 adminFlags: UserAdminFlag.NONE
637 })
638
639 const res = await getUserInformation(server.url, accessToken, userId)
640 const user = res.body
641
642 expect(user.username).to.equal('user_1')
643 expect(user.email).to.equal('updated2@example.com')
644 expect(user.emailVerified).to.be.true
645 expect(user.nsfwPolicy).to.equal('do_not_list')
646 expect(user.videoQuota).to.equal(42)
647 expect(user.roleLabel).to.equal('Moderator')
648 expect(user.id).to.be.a('number')
649 expect(user.adminFlags).to.equal(UserAdminFlag.NONE)
650 })
651
652 it('Should have removed the user token', async function () {
653 await getMyUserVideoQuotaUsed(server.url, accessTokenUser, 401)
654
655 accessTokenUser = await userLogin(server, user)
656 })
657
658 it('Should be able to update another user password', async function () {
659 await updateUser({
660 url: server.url,
661 userId,
662 accessToken,
663 password: 'password updated'
664 })
665
666 await getMyUserVideoQuotaUsed(server.url, accessTokenUser, 401)
667
668 await userLogin(server, user, 400)
669
670 user.password = 'password updated'
671 accessTokenUser = await userLogin(server, user)
672 })
673 })
674
675 describe('Video blacklists', function () {
676 it('Should be able to list video blacklist by a moderator', async function () {
677 await getBlacklistedVideosList({ url: server.url, token: accessTokenUser })
678 })
679 })
680
681 describe('Remove a user', function () {
682 it('Should be able to remove this user', async function () {
683 await removeUser(server.url, userId, accessToken)
684 })
685
686 it('Should not be able to login with this user', async function () {
687 await userLogin(server, user, 400)
688 })
689
690 it('Should not have videos of this user', async function () {
691 const res = await getVideosList(server.url)
692
693 expect(res.body.total).to.equal(1)
694
695 const video = res.body.data[0]
696 expect(video.account.name).to.equal('root')
697 })
698 })
699
700 describe('Registering a new user', function () {
701 it('Should register a new user', async function () {
702 const user = { displayName: 'super user 15', username: 'user_15', password: 'my super password' }
703 const channel = { name: 'my_user_15_channel', displayName: 'my channel rocks' }
704
705 await registerUserWithChannel({ url: server.url, user, channel })
706 })
707
708 it('Should be able to login with this registered user', async function () {
709 const user15 = {
710 username: 'user_15',
711 password: 'my super password'
712 }
713
714 accessToken = await userLogin(server, user15)
715 })
716
717 it('Should have the correct display name', async function () {
718 const res = await getMyUserInformation(server.url, accessToken)
719 const user: User = res.body
720
721 expect(user.account.displayName).to.equal('super user 15')
722 })
723
724 it('Should have the correct video quota', async function () {
725 const res = await getMyUserInformation(server.url, accessToken)
726 const user = res.body
727
728 expect(user.videoQuota).to.equal(5 * 1024 * 1024)
729 })
730
731 it('Should have created the channel', async function () {
732 const res = await getVideoChannel(server.url, 'my_user_15_channel')
733
734 expect(res.body.displayName).to.equal('my channel rocks')
735 })
736
737 it('Should remove me', async function () {
738 {
739 const res = await getUsersList(server.url, server.accessToken)
740 expect(res.body.data.find(u => u.username === 'user_15')).to.not.be.undefined
741 }
742
743 await deleteMe(server.url, accessToken)
744
745 {
746 const res = await getUsersList(server.url, server.accessToken)
747 expect(res.body.data.find(u => u.username === 'user_15')).to.be.undefined
748 }
749 })
750 })
751
752 describe('User blocking', function () {
753 it('Should block and unblock a user', async function () {
754 const user16 = {
755 username: 'user_16',
756 password: 'my super password'
757 }
758 const resUser = await createUser({
759 url: server.url,
760 accessToken: server.accessToken,
761 username: user16.username,
762 password: user16.password
763 })
764 const user16Id = resUser.body.user.id
765
766 accessToken = await userLogin(server, user16)
767
768 await getMyUserInformation(server.url, accessToken, 200)
769 await blockUser(server.url, user16Id, server.accessToken)
770
771 await getMyUserInformation(server.url, accessToken, 401)
772 await userLogin(server, user16, 400)
773
774 await unblockUser(server.url, user16Id, server.accessToken)
775 accessToken = await userLogin(server, user16)
776 await getMyUserInformation(server.url, accessToken, 200)
777 })
778 })
779
780 after(async function () {
781 await cleanupTests([ server ])
782 })
783 })