1 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
3 import * as chai from 'chai'
5 import { MyUser, User, UserRole, Video, VideoPlaylistType, VideoAbuseState, VideoAbuseUpdate } from '../../../../shared/index'
13 getBlacklistedVideosList,
15 getMyUserVideoQuotaUsed,
19 getUsersListPaginationAndSort,
26 registerUserWithChannel,
38 addVideoCommentThread,
40 getVideoAbusesList, updateCustomSubConfig, getCustomConfig, waitJobs
41 } from '../../../../shared/extra-utils'
42 import { follow } from '../../../../shared/extra-utils/server/follows'
43 import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login'
44 import { getMyVideos } from '../../../../shared/extra-utils/videos/videos'
45 import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
46 import { CustomConfig } from '@shared/models/server'
48 const expect = chai.expect
50 describe('Test users', function () {
51 let server: ServerInfo
52 let accessToken: string
53 let accessTokenUser: string
58 password: 'super password'
61 before(async function () {
63 server = await flushAndRunServer(1)
65 await setAccessTokensToServers([ server ])
67 await installPlugin({ url: server.url, accessToken: server.accessToken, npmName: 'peertube-theme-background-red' })
70 describe('OAuth client', function () {
71 it('Should create a new client')
73 it('Should return the first client')
75 it('Should remove the last client')
77 it('Should not login with an invalid client id', async function () {
78 const client = { id: 'client', secret: server.client.secret }
79 const res = await login(server.url, client, server.user, 400)
81 expect(res.body.error).to.contain('client is invalid')
84 it('Should not login with an invalid client secret', async function () {
85 const client = { id: server.client.id, secret: 'coucou' }
86 const res = await login(server.url, client, server.user, 400)
88 expect(res.body.error).to.contain('client is invalid')
92 describe('Login', function () {
94 it('Should not login with an invalid username', async function () {
95 const user = { username: 'captain crochet', password: server.user.password }
96 const res = await login(server.url, server.client, user, 400)
98 expect(res.body.error).to.contain('credentials are invalid')
101 it('Should not login with an invalid password', async function () {
102 const user = { username: server.user.username, password: 'mew_three' }
103 const res = await login(server.url, server.client, user, 400)
105 expect(res.body.error).to.contain('credentials are invalid')
108 it('Should not be able to upload a video', async function () {
109 accessToken = 'my_super_token'
111 const videoAttributes = {}
112 await uploadVideo(server.url, accessToken, videoAttributes, 401)
115 it('Should not be able to follow', async function () {
116 accessToken = 'my_super_token'
117 await follow(server.url, [ 'http://example.com' ], accessToken, 401)
120 it('Should not be able to unfollow')
122 it('Should be able to login', async function () {
123 const res = await login(server.url, server.client, server.user, 200)
125 accessToken = res.body.access_token
128 it('Should be able to login with an insensitive username', async function () {
129 const user = { username: 'RoOt', password: server.user.password }
130 await login(server.url, server.client, user, 200)
132 const user2 = { username: 'rOoT', password: server.user.password }
133 await login(server.url, server.client, user2, 200)
135 const user3 = { username: 'ROOt', password: server.user.password }
136 await login(server.url, server.client, user3, 200)
140 describe('Upload', function () {
142 it('Should upload the video with the correct token', async function () {
143 const videoAttributes = {}
144 await uploadVideo(server.url, accessToken, videoAttributes)
145 const res = await getVideosList(server.url)
146 const video = res.body.data[0]
148 expect(video.account.name).to.equal('root')
152 it('Should upload the video again with the correct token', async function () {
153 const videoAttributes = {}
154 await uploadVideo(server.url, accessToken, videoAttributes)
158 describe('Ratings', function () {
160 it('Should retrieve a video rating', async function () {
161 await rateVideo(server.url, accessToken, videoId, 'like')
162 const res = await getMyUserVideoRating(server.url, accessToken, videoId)
163 const rating = res.body
165 expect(rating.videoId).to.equal(videoId)
166 expect(rating.rating).to.equal('like')
169 it('Should retrieve ratings list', async function () {
170 await rateVideo(server.url, accessToken, videoId, 'like')
172 const res = await getAccountRatings(server.url, server.user.username, server.accessToken, null, 200)
173 const ratings = res.body
175 expect(ratings.total).to.equal(1)
176 expect(ratings.data[0].video.id).to.equal(videoId)
177 expect(ratings.data[0].rating).to.equal('like')
180 it('Should retrieve ratings list by rating type', async function () {
182 const res = await getAccountRatings(server.url, server.user.username, server.accessToken, 'like')
183 const ratings = res.body
184 expect(ratings.data.length).to.equal(1)
188 const res = await getAccountRatings(server.url, server.user.username, server.accessToken, 'dislike')
189 const ratings = res.body
190 expect(ratings.data.length).to.equal(0)
195 describe('Remove video', function () {
196 it('Should not be able to remove the video with an incorrect token', async function () {
197 await removeVideo(server.url, 'bad_token', videoId, 401)
200 it('Should not be able to remove the video with the token of another account')
202 it('Should be able to remove the video with the correct token', async function () {
203 await removeVideo(server.url, accessToken, videoId)
207 describe('Logout', function () {
208 it('Should logout (revoke token)')
210 it('Should not be able to get the user information')
212 it('Should not be able to upload a video')
214 it('Should not be able to remove a video')
216 it('Should not be able to rate a video', async function () {
217 const path = '/api/v1/videos/'
224 path: path + videoId,
225 token: 'wrong token',
227 statusCodeExpected: 401
229 await makePutBodyRequest(options)
232 it('Should be able to login again')
234 it('Should have an expired access token')
236 it('Should refresh the token')
238 it('Should be able to upload a video again')
241 describe('Creating a user', function () {
243 it('Should be able to create a new user', async function () {
246 accessToken: accessToken,
247 username: user.username,
248 password: user.password,
249 videoQuota: 2 * 1024 * 1024,
250 adminFlags: UserAdminFlag.BY_PASS_VIDEO_AUTO_BLACKLIST
254 it('Should be able to login with this user', async function () {
255 accessTokenUser = await userLogin(server, user)
258 it('Should be able to get user information', async function () {
259 const res1 = await getMyUserInformation(server.url, accessTokenUser)
260 const userMe: MyUser = res1.body
262 const res2 = await getUserInformation(server.url, server.accessToken, userMe.id, true)
263 const userGet: User = res2.body
265 for (const user of [ userMe, userGet ]) {
266 expect(user.username).to.equal('user_1')
267 expect(user.email).to.equal('user_1@example.com')
268 expect(user.nsfwPolicy).to.equal('display')
269 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
270 expect(user.roleLabel).to.equal('User')
271 expect(user.id).to.be.a('number')
272 expect(user.account.displayName).to.equal('user_1')
273 expect(user.account.description).to.be.null
276 expect(userMe.adminFlags).to.be.undefined
277 expect(userGet.adminFlags).to.equal(UserAdminFlag.BY_PASS_VIDEO_AUTO_BLACKLIST)
279 expect(userMe.specialPlaylists).to.have.lengthOf(1)
280 expect(userMe.specialPlaylists[0].type).to.equal(VideoPlaylistType.WATCH_LATER)
282 // Check stats are included with withStats
283 expect(userGet.videosCount).to.be.a('number')
284 expect(userGet.videosCount).to.equal(0)
285 expect(userGet.videoCommentsCount).to.be.a('number')
286 expect(userGet.videoCommentsCount).to.equal(0)
287 expect(userGet.videoAbusesCount).to.be.a('number')
288 expect(userGet.videoAbusesCount).to.equal(0)
289 expect(userGet.videoAbusesAcceptedCount).to.be.a('number')
290 expect(userGet.videoAbusesAcceptedCount).to.equal(0)
294 describe('My videos & quotas', function () {
296 it('Should be able to upload a video with this user', async function () {
299 const videoAttributes = {
300 name: 'super user video',
301 fixture: 'video_short.webm'
303 await uploadVideo(server.url, accessTokenUser, videoAttributes)
306 it('Should have video quota updated', async function () {
307 const res = await getMyUserVideoQuotaUsed(server.url, accessTokenUser)
308 const data = res.body
310 expect(data.videoQuotaUsed).to.equal(218910)
312 const resUsers = await getUsersList(server.url, server.accessToken)
314 const users: User[] = resUsers.body.data
315 const tmpUser = users.find(u => u.username === user.username)
316 expect(tmpUser.videoQuotaUsed).to.equal(218910)
319 it('Should be able to list my videos', async function () {
320 const res = await getMyVideos(server.url, accessTokenUser, 0, 5)
321 expect(res.body.total).to.equal(1)
323 const videos = res.body.data
324 expect(videos).to.have.lengthOf(1)
326 const video: Video = videos[0]
327 expect(video.name).to.equal('super user video')
328 expect(video.thumbnailPath).to.not.be.null
329 expect(video.previewPath).to.not.be.null
332 it('Should be able to search in my videos', async function () {
334 const res = await getMyVideos(server.url, accessTokenUser, 0, 5, '-createdAt', 'user video')
335 expect(res.body.total).to.equal(1)
337 const videos = res.body.data
338 expect(videos).to.have.lengthOf(1)
342 const res = await getMyVideos(server.url, accessTokenUser, 0, 5, '-createdAt', 'toto')
343 expect(res.body.total).to.equal(0)
345 const videos = res.body.data
346 expect(videos).to.have.lengthOf(0)
350 it('Should disable webtorrent, enable HLS, and update my quota', async function () {
354 const res = await getCustomConfig(server.url, server.accessToken)
355 const config = res.body as CustomConfig
356 config.transcoding.webtorrent.enabled = false
357 config.transcoding.hls.enabled = true
358 config.transcoding.enabled = true
359 await updateCustomSubConfig(server.url, server.accessToken, config)
363 const videoAttributes = {
364 name: 'super user video 2',
365 fixture: 'video_short.webm'
367 await uploadVideo(server.url, accessTokenUser, videoAttributes)
369 await waitJobs([ server ])
373 const res = await getMyUserVideoQuotaUsed(server.url, accessTokenUser)
374 const data = res.body
376 expect(data.videoQuotaUsed).to.be.greaterThan(220000)
381 describe('Users listing', function () {
383 it('Should list all the users', async function () {
384 const res = await getUsersList(server.url, server.accessToken)
385 const result = res.body
386 const total = result.total
387 const users = result.data
389 expect(total).to.equal(2)
390 expect(users).to.be.an('array')
391 expect(users.length).to.equal(2)
393 const user = users[0]
394 expect(user.username).to.equal('user_1')
395 expect(user.email).to.equal('user_1@example.com')
396 expect(user.nsfwPolicy).to.equal('display')
398 const rootUser = users[1]
399 expect(rootUser.username).to.equal('root')
400 expect(rootUser.email).to.equal('admin' + server.internalServerNumber + '@example.com')
401 expect(user.nsfwPolicy).to.equal('display')
406 it('Should list only the first user by username asc', async function () {
407 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 1, 'username')
409 const result = res.body
410 const total = result.total
411 const users = result.data
413 expect(total).to.equal(2)
414 expect(users.length).to.equal(1)
416 const user = users[0]
417 expect(user.username).to.equal('root')
418 expect(user.email).to.equal('admin' + server.internalServerNumber + '@example.com')
419 expect(user.roleLabel).to.equal('Administrator')
420 expect(user.nsfwPolicy).to.equal('display')
423 it('Should list only the first user by username desc', async function () {
424 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 1, '-username')
425 const result = res.body
426 const total = result.total
427 const users = result.data
429 expect(total).to.equal(2)
430 expect(users.length).to.equal(1)
432 const user = users[0]
433 expect(user.username).to.equal('user_1')
434 expect(user.email).to.equal('user_1@example.com')
435 expect(user.nsfwPolicy).to.equal('display')
438 it('Should list only the second user by createdAt desc', async function () {
439 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 1, '-createdAt')
440 const result = res.body
441 const total = result.total
442 const users = result.data
444 expect(total).to.equal(2)
445 expect(users.length).to.equal(1)
447 const user = users[0]
448 expect(user.username).to.equal('user_1')
449 expect(user.email).to.equal('user_1@example.com')
450 expect(user.nsfwPolicy).to.equal('display')
453 it('Should list all the users by createdAt asc', async function () {
454 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 2, 'createdAt')
455 const result = res.body
456 const total = result.total
457 const users = result.data
459 expect(total).to.equal(2)
460 expect(users.length).to.equal(2)
462 expect(users[0].username).to.equal('root')
463 expect(users[0].email).to.equal('admin' + server.internalServerNumber + '@example.com')
464 expect(users[0].nsfwPolicy).to.equal('display')
466 expect(users[1].username).to.equal('user_1')
467 expect(users[1].email).to.equal('user_1@example.com')
468 expect(users[1].nsfwPolicy).to.equal('display')
471 it('Should search user by username', async function () {
472 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 2, 'createdAt', 'oot')
473 const users = res.body.data as User[]
475 expect(res.body.total).to.equal(1)
476 expect(users.length).to.equal(1)
478 expect(users[0].username).to.equal('root')
481 it('Should search user by email', async function () {
483 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 2, 'createdAt', 'r_1@exam')
484 const users = res.body.data as User[]
486 expect(res.body.total).to.equal(1)
487 expect(users.length).to.equal(1)
489 expect(users[0].username).to.equal('user_1')
490 expect(users[0].email).to.equal('user_1@example.com')
494 const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 2, 'createdAt', 'example')
495 const users = res.body.data as User[]
497 expect(res.body.total).to.equal(2)
498 expect(users.length).to.equal(2)
500 expect(users[0].username).to.equal('root')
501 expect(users[1].username).to.equal('user_1')
506 describe('Update my account', function () {
507 it('Should update my password', async function () {
510 accessToken: accessTokenUser,
511 currentPassword: 'super password',
512 password: 'new password'
514 user.password = 'new password'
516 await userLogin(server, user, 200)
519 it('Should be able to change the NSFW display attribute', async function () {
522 accessToken: accessTokenUser,
523 nsfwPolicy: 'do_not_list'
526 const res = await getMyUserInformation(server.url, accessTokenUser)
527 const user = res.body
529 expect(user.username).to.equal('user_1')
530 expect(user.email).to.equal('user_1@example.com')
531 expect(user.nsfwPolicy).to.equal('do_not_list')
532 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
533 expect(user.id).to.be.a('number')
534 expect(user.account.displayName).to.equal('user_1')
535 expect(user.account.description).to.be.null
538 it('Should be able to change the autoPlayVideo attribute', async function () {
541 accessToken: accessTokenUser,
545 const res = await getMyUserInformation(server.url, accessTokenUser)
546 const user = res.body
548 expect(user.autoPlayVideo).to.be.false
551 it('Should be able to change the autoPlayNextVideo attribute', async function () {
554 accessToken: accessTokenUser,
555 autoPlayNextVideo: true
558 const res = await getMyUserInformation(server.url, accessTokenUser)
559 const user = res.body
561 expect(user.autoPlayNextVideo).to.be.true
564 it('Should be able to change the email attribute', async function () {
567 accessToken: accessTokenUser,
568 currentPassword: 'new password',
569 email: 'updated@example.com'
572 const res = await getMyUserInformation(server.url, accessTokenUser)
573 const user = res.body
575 expect(user.username).to.equal('user_1')
576 expect(user.email).to.equal('updated@example.com')
577 expect(user.nsfwPolicy).to.equal('do_not_list')
578 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
579 expect(user.id).to.be.a('number')
580 expect(user.account.displayName).to.equal('user_1')
581 expect(user.account.description).to.be.null
584 it('Should be able to update my avatar', async function () {
585 const fixture = 'avatar.png'
587 await updateMyAvatar({
589 accessToken: accessTokenUser,
593 const res = await getMyUserInformation(server.url, accessTokenUser)
594 const user = res.body
596 await testImage(server.url, 'avatar-resized', user.account.avatar.path, '.png')
599 it('Should be able to update my display name', async function () {
602 accessToken: accessTokenUser,
603 displayName: 'new display name'
606 const res = await getMyUserInformation(server.url, accessTokenUser)
607 const user = res.body
609 expect(user.username).to.equal('user_1')
610 expect(user.email).to.equal('updated@example.com')
611 expect(user.nsfwPolicy).to.equal('do_not_list')
612 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
613 expect(user.id).to.be.a('number')
614 expect(user.account.displayName).to.equal('new display name')
615 expect(user.account.description).to.be.null
618 it('Should be able to update my description', async function () {
621 accessToken: accessTokenUser,
622 description: 'my super description updated'
625 const res = await getMyUserInformation(server.url, accessTokenUser)
626 const user: User = res.body
628 expect(user.username).to.equal('user_1')
629 expect(user.email).to.equal('updated@example.com')
630 expect(user.nsfwPolicy).to.equal('do_not_list')
631 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
632 expect(user.id).to.be.a('number')
633 expect(user.account.displayName).to.equal('new display name')
634 expect(user.account.description).to.equal('my super description updated')
635 expect(user.noWelcomeModal).to.be.false
636 expect(user.noInstanceConfigWarningModal).to.be.false
639 it('Should be able to update my theme', async function () {
640 for (const theme of [ 'background-red', 'default', 'instance-default' ]) {
643 accessToken: accessTokenUser,
647 const res = await getMyUserInformation(server.url, accessTokenUser)
648 const body: User = res.body
650 expect(body.theme).to.equal(theme)
654 it('Should be able to update my modal preferences', async function () {
657 accessToken: accessTokenUser,
658 noInstanceConfigWarningModal: true,
662 const res = await getMyUserInformation(server.url, accessTokenUser)
663 const user: User = res.body
665 expect(user.noWelcomeModal).to.be.true
666 expect(user.noInstanceConfigWarningModal).to.be.true
670 describe('Updating another user', function () {
671 it('Should be able to update another user', async function () {
676 email: 'updated2@example.com',
679 role: UserRole.MODERATOR,
680 adminFlags: UserAdminFlag.NONE
683 const res = await getUserInformation(server.url, accessToken, userId)
684 const user = res.body
686 expect(user.username).to.equal('user_1')
687 expect(user.email).to.equal('updated2@example.com')
688 expect(user.emailVerified).to.be.true
689 expect(user.nsfwPolicy).to.equal('do_not_list')
690 expect(user.videoQuota).to.equal(42)
691 expect(user.roleLabel).to.equal('Moderator')
692 expect(user.id).to.be.a('number')
693 expect(user.adminFlags).to.equal(UserAdminFlag.NONE)
696 it('Should have removed the user token', async function () {
697 await getMyUserVideoQuotaUsed(server.url, accessTokenUser, 401)
699 accessTokenUser = await userLogin(server, user)
702 it('Should be able to update another user password', async function () {
707 password: 'password updated'
710 await getMyUserVideoQuotaUsed(server.url, accessTokenUser, 401)
712 await userLogin(server, user, 400)
714 user.password = 'password updated'
715 accessTokenUser = await userLogin(server, user)
719 describe('Video blacklists', function () {
720 it('Should be able to list video blacklist by a moderator', async function () {
721 await getBlacklistedVideosList({ url: server.url, token: accessTokenUser })
725 describe('Remove a user', function () {
726 it('Should be able to remove this user', async function () {
727 await removeUser(server.url, userId, accessToken)
730 it('Should not be able to login with this user', async function () {
731 await userLogin(server, user, 400)
734 it('Should not have videos of this user', async function () {
735 const res = await getVideosList(server.url)
737 expect(res.body.total).to.equal(1)
739 const video = res.body.data[0]
740 expect(video.account.name).to.equal('root')
744 describe('Registering a new user', function () {
745 let user15AccessToken
747 it('Should register a new user', async function () {
748 const user = { displayName: 'super user 15', username: 'user_15', password: 'my super password' }
749 const channel = { name: 'my_user_15_channel', displayName: 'my channel rocks' }
751 await registerUserWithChannel({ url: server.url, user, channel })
754 it('Should be able to login with this registered user', async function () {
757 password: 'my super password'
760 user15AccessToken = await userLogin(server, user15)
763 it('Should have the correct display name', async function () {
764 const res = await getMyUserInformation(server.url, user15AccessToken)
765 const user: User = res.body
767 expect(user.account.displayName).to.equal('super user 15')
770 it('Should have the correct video quota', async function () {
771 const res = await getMyUserInformation(server.url, user15AccessToken)
772 const user = res.body
774 expect(user.videoQuota).to.equal(5 * 1024 * 1024)
777 it('Should have created the channel', async function () {
778 const res = await getVideoChannel(server.url, 'my_user_15_channel')
780 expect(res.body.displayName).to.equal('my channel rocks')
783 it('Should remove me', async function () {
785 const res = await getUsersList(server.url, server.accessToken)
786 expect(res.body.data.find(u => u.username === 'user_15')).to.not.be.undefined
789 await deleteMe(server.url, user15AccessToken)
792 const res = await getUsersList(server.url, server.accessToken)
793 expect(res.body.data.find(u => u.username === 'user_15')).to.be.undefined
798 describe('User blocking', function () {
800 let user16AccessToken
802 it('Should block and unblock a user', async function () {
805 password: 'my super password'
807 const resUser = await createUser({
809 accessToken: server.accessToken,
810 username: user16.username,
811 password: user16.password
813 user16Id = resUser.body.user.id
815 user16AccessToken = await userLogin(server, user16)
817 await getMyUserInformation(server.url, user16AccessToken, 200)
818 await blockUser(server.url, user16Id, server.accessToken)
820 await getMyUserInformation(server.url, user16AccessToken, 401)
821 await userLogin(server, user16, 400)
823 await unblockUser(server.url, user16Id, server.accessToken)
824 user16AccessToken = await userLogin(server, user16)
825 await getMyUserInformation(server.url, user16AccessToken, 200)
829 describe('User stats', function () {
831 let user17AccessToken
833 it('Should report correct initial statistics about a user', async function () {
836 password: 'my super password'
838 const resUser = await createUser({
840 accessToken: server.accessToken,
841 username: user17.username,
842 password: user17.password
845 user17Id = resUser.body.user.id
846 user17AccessToken = await userLogin(server, user17)
848 const res = await getUserInformation(server.url, server.accessToken, user17Id, true)
849 const user: User = res.body
851 expect(user.videosCount).to.equal(0)
852 expect(user.videoCommentsCount).to.equal(0)
853 expect(user.videoAbusesCount).to.equal(0)
854 expect(user.videoAbusesCreatedCount).to.equal(0)
855 expect(user.videoAbusesAcceptedCount).to.equal(0)
858 it('Should report correct videos count', async function () {
859 const videoAttributes = {
860 name: 'video to test user stats'
862 await uploadVideo(server.url, user17AccessToken, videoAttributes)
863 const res1 = await getVideosList(server.url)
864 videoId = res1.body.data.find(video => video.name === videoAttributes.name).id
866 const res2 = await getUserInformation(server.url, server.accessToken, user17Id, true)
867 const user: User = res2.body
869 expect(user.videosCount).to.equal(1)
872 it('Should report correct video comments for user', async function () {
873 const text = 'super comment'
874 await addVideoCommentThread(server.url, user17AccessToken, videoId, text)
876 const res = await getUserInformation(server.url, server.accessToken, user17Id, true)
877 const user: User = res.body
879 expect(user.videoCommentsCount).to.equal(1)
882 it('Should report correct video abuses counts', async function () {
883 const reason = 'my super bad reason'
884 await reportVideoAbuse(server.url, user17AccessToken, videoId, reason)
886 const res1 = await getVideoAbusesList(server.url, server.accessToken)
887 const abuseId = res1.body.data[0].id
889 const res2 = await getUserInformation(server.url, server.accessToken, user17Id, true)
890 const user2: User = res2.body
892 expect(user2.videoAbusesCount).to.equal(1) // number of incriminations
893 expect(user2.videoAbusesCreatedCount).to.equal(1) // number of reports created
895 const body: VideoAbuseUpdate = { state: VideoAbuseState.ACCEPTED }
896 await updateVideoAbuse(server.url, server.accessToken, videoId, abuseId, body)
898 const res3 = await getUserInformation(server.url, server.accessToken, user17Id, true)
899 const user3: User = res3.body
901 expect(user3.videoAbusesAcceptedCount).to.equal(1) // number of reports created accepted
905 after(async function () {
906 await cleanupTests([ server ])