diff options
Diffstat (limited to 'server/tests/api/users/users.ts')
-rw-r--r-- | server/tests/api/users/users.ts | 529 |
1 files changed, 0 insertions, 529 deletions
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts deleted file mode 100644 index 67ade1d0d..000000000 --- a/server/tests/api/users/users.ts +++ /dev/null | |||
@@ -1,529 +0,0 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | ||
2 | |||
3 | import { expect } from 'chai' | ||
4 | import { testImageSize } from '@server/tests/shared' | ||
5 | import { AbuseState, HttpStatusCode, UserAdminFlag, UserRole, VideoPlaylistType } from '@shared/models' | ||
6 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | ||
7 | |||
8 | describe('Test users', function () { | ||
9 | let server: PeerTubeServer | ||
10 | let token: string | ||
11 | let userToken: string | ||
12 | let videoId: number | ||
13 | let userId: number | ||
14 | const user = { | ||
15 | username: 'user_1', | ||
16 | password: 'super password' | ||
17 | } | ||
18 | |||
19 | before(async function () { | ||
20 | this.timeout(30000) | ||
21 | |||
22 | server = await createSingleServer(1, { | ||
23 | rates_limit: { | ||
24 | login: { | ||
25 | max: 30 | ||
26 | } | ||
27 | } | ||
28 | }) | ||
29 | |||
30 | await setAccessTokensToServers([ server ]) | ||
31 | |||
32 | await server.plugins.install({ npmName: 'peertube-theme-background-red' }) | ||
33 | }) | ||
34 | |||
35 | describe('Creating a user', function () { | ||
36 | |||
37 | it('Should be able to create a new user', async function () { | ||
38 | await server.users.create({ ...user, videoQuota: 2 * 1024 * 1024, adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST }) | ||
39 | }) | ||
40 | |||
41 | it('Should be able to login with this user', async function () { | ||
42 | userToken = await server.login.getAccessToken(user) | ||
43 | }) | ||
44 | |||
45 | it('Should be able to get user information', async function () { | ||
46 | const userMe = await server.users.getMyInfo({ token: userToken }) | ||
47 | |||
48 | const userGet = await server.users.get({ userId: userMe.id, withStats: true }) | ||
49 | |||
50 | for (const user of [ userMe, userGet ]) { | ||
51 | expect(user.username).to.equal('user_1') | ||
52 | expect(user.email).to.equal('user_1@example.com') | ||
53 | expect(user.nsfwPolicy).to.equal('display') | ||
54 | expect(user.videoQuota).to.equal(2 * 1024 * 1024) | ||
55 | expect(user.role.label).to.equal('User') | ||
56 | expect(user.id).to.be.a('number') | ||
57 | expect(user.account.displayName).to.equal('user_1') | ||
58 | expect(user.account.description).to.be.null | ||
59 | } | ||
60 | |||
61 | expect(userMe.adminFlags).to.equal(UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST) | ||
62 | expect(userGet.adminFlags).to.equal(UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST) | ||
63 | |||
64 | expect(userMe.specialPlaylists).to.have.lengthOf(1) | ||
65 | expect(userMe.specialPlaylists[0].type).to.equal(VideoPlaylistType.WATCH_LATER) | ||
66 | |||
67 | // Check stats are included with withStats | ||
68 | expect(userGet.videosCount).to.be.a('number') | ||
69 | expect(userGet.videosCount).to.equal(0) | ||
70 | expect(userGet.videoCommentsCount).to.be.a('number') | ||
71 | expect(userGet.videoCommentsCount).to.equal(0) | ||
72 | expect(userGet.abusesCount).to.be.a('number') | ||
73 | expect(userGet.abusesCount).to.equal(0) | ||
74 | expect(userGet.abusesAcceptedCount).to.be.a('number') | ||
75 | expect(userGet.abusesAcceptedCount).to.equal(0) | ||
76 | }) | ||
77 | }) | ||
78 | |||
79 | describe('Users listing', function () { | ||
80 | |||
81 | it('Should list all the users', async function () { | ||
82 | const { data, total } = await server.users.list() | ||
83 | |||
84 | expect(total).to.equal(2) | ||
85 | expect(data).to.be.an('array') | ||
86 | expect(data.length).to.equal(2) | ||
87 | |||
88 | const user = data[0] | ||
89 | expect(user.username).to.equal('user_1') | ||
90 | expect(user.email).to.equal('user_1@example.com') | ||
91 | expect(user.nsfwPolicy).to.equal('display') | ||
92 | |||
93 | const rootUser = data[1] | ||
94 | expect(rootUser.username).to.equal('root') | ||
95 | expect(rootUser.email).to.equal('admin' + server.internalServerNumber + '@example.com') | ||
96 | expect(user.nsfwPolicy).to.equal('display') | ||
97 | |||
98 | expect(rootUser.lastLoginDate).to.exist | ||
99 | expect(user.lastLoginDate).to.exist | ||
100 | |||
101 | userId = user.id | ||
102 | }) | ||
103 | |||
104 | it('Should list only the first user by username asc', async function () { | ||
105 | const { total, data } = await server.users.list({ start: 0, count: 1, sort: 'username' }) | ||
106 | |||
107 | expect(total).to.equal(2) | ||
108 | expect(data.length).to.equal(1) | ||
109 | |||
110 | const user = data[0] | ||
111 | expect(user.username).to.equal('root') | ||
112 | expect(user.email).to.equal('admin' + server.internalServerNumber + '@example.com') | ||
113 | expect(user.role.label).to.equal('Administrator') | ||
114 | expect(user.nsfwPolicy).to.equal('display') | ||
115 | }) | ||
116 | |||
117 | it('Should list only the first user by username desc', async function () { | ||
118 | const { total, data } = await server.users.list({ start: 0, count: 1, sort: '-username' }) | ||
119 | |||
120 | expect(total).to.equal(2) | ||
121 | expect(data.length).to.equal(1) | ||
122 | |||
123 | const user = data[0] | ||
124 | expect(user.username).to.equal('user_1') | ||
125 | expect(user.email).to.equal('user_1@example.com') | ||
126 | expect(user.nsfwPolicy).to.equal('display') | ||
127 | }) | ||
128 | |||
129 | it('Should list only the second user by createdAt desc', async function () { | ||
130 | const { data, total } = await server.users.list({ start: 0, count: 1, sort: '-createdAt' }) | ||
131 | expect(total).to.equal(2) | ||
132 | |||
133 | expect(data.length).to.equal(1) | ||
134 | |||
135 | const user = data[0] | ||
136 | expect(user.username).to.equal('user_1') | ||
137 | expect(user.email).to.equal('user_1@example.com') | ||
138 | expect(user.nsfwPolicy).to.equal('display') | ||
139 | }) | ||
140 | |||
141 | it('Should list all the users by createdAt asc', async function () { | ||
142 | const { data, total } = await server.users.list({ start: 0, count: 2, sort: 'createdAt' }) | ||
143 | |||
144 | expect(total).to.equal(2) | ||
145 | expect(data.length).to.equal(2) | ||
146 | |||
147 | expect(data[0].username).to.equal('root') | ||
148 | expect(data[0].email).to.equal('admin' + server.internalServerNumber + '@example.com') | ||
149 | expect(data[0].nsfwPolicy).to.equal('display') | ||
150 | |||
151 | expect(data[1].username).to.equal('user_1') | ||
152 | expect(data[1].email).to.equal('user_1@example.com') | ||
153 | expect(data[1].nsfwPolicy).to.equal('display') | ||
154 | }) | ||
155 | |||
156 | it('Should search user by username', async function () { | ||
157 | const { data, total } = await server.users.list({ start: 0, count: 2, sort: 'createdAt', search: 'oot' }) | ||
158 | expect(total).to.equal(1) | ||
159 | expect(data.length).to.equal(1) | ||
160 | expect(data[0].username).to.equal('root') | ||
161 | }) | ||
162 | |||
163 | it('Should search user by email', async function () { | ||
164 | { | ||
165 | const { total, data } = await server.users.list({ start: 0, count: 2, sort: 'createdAt', search: 'r_1@exam' }) | ||
166 | expect(total).to.equal(1) | ||
167 | expect(data.length).to.equal(1) | ||
168 | expect(data[0].username).to.equal('user_1') | ||
169 | expect(data[0].email).to.equal('user_1@example.com') | ||
170 | } | ||
171 | |||
172 | { | ||
173 | const { total, data } = await server.users.list({ start: 0, count: 2, sort: 'createdAt', search: 'example' }) | ||
174 | expect(total).to.equal(2) | ||
175 | expect(data.length).to.equal(2) | ||
176 | expect(data[0].username).to.equal('root') | ||
177 | expect(data[1].username).to.equal('user_1') | ||
178 | } | ||
179 | }) | ||
180 | }) | ||
181 | |||
182 | describe('Update my account', function () { | ||
183 | |||
184 | it('Should update my password', async function () { | ||
185 | await server.users.updateMe({ | ||
186 | token: userToken, | ||
187 | currentPassword: 'super password', | ||
188 | password: 'new password' | ||
189 | }) | ||
190 | user.password = 'new password' | ||
191 | |||
192 | await server.login.login({ user }) | ||
193 | }) | ||
194 | |||
195 | it('Should be able to change the NSFW display attribute', async function () { | ||
196 | await server.users.updateMe({ | ||
197 | token: userToken, | ||
198 | nsfwPolicy: 'do_not_list' | ||
199 | }) | ||
200 | |||
201 | const user = await server.users.getMyInfo({ token: userToken }) | ||
202 | expect(user.username).to.equal('user_1') | ||
203 | expect(user.email).to.equal('user_1@example.com') | ||
204 | expect(user.nsfwPolicy).to.equal('do_not_list') | ||
205 | expect(user.videoQuota).to.equal(2 * 1024 * 1024) | ||
206 | expect(user.id).to.be.a('number') | ||
207 | expect(user.account.displayName).to.equal('user_1') | ||
208 | expect(user.account.description).to.be.null | ||
209 | }) | ||
210 | |||
211 | it('Should be able to change the autoPlayVideo attribute', async function () { | ||
212 | await server.users.updateMe({ | ||
213 | token: userToken, | ||
214 | autoPlayVideo: false | ||
215 | }) | ||
216 | |||
217 | const user = await server.users.getMyInfo({ token: userToken }) | ||
218 | expect(user.autoPlayVideo).to.be.false | ||
219 | }) | ||
220 | |||
221 | it('Should be able to change the autoPlayNextVideo attribute', async function () { | ||
222 | await server.users.updateMe({ | ||
223 | token: userToken, | ||
224 | autoPlayNextVideo: true | ||
225 | }) | ||
226 | |||
227 | const user = await server.users.getMyInfo({ token: userToken }) | ||
228 | expect(user.autoPlayNextVideo).to.be.true | ||
229 | }) | ||
230 | |||
231 | it('Should be able to change the p2p attribute', async function () { | ||
232 | await server.users.updateMe({ | ||
233 | token: userToken, | ||
234 | p2pEnabled: true | ||
235 | }) | ||
236 | |||
237 | const user = await server.users.getMyInfo({ token: userToken }) | ||
238 | expect(user.p2pEnabled).to.be.true | ||
239 | }) | ||
240 | |||
241 | it('Should be able to change the email attribute', async function () { | ||
242 | await server.users.updateMe({ | ||
243 | token: userToken, | ||
244 | currentPassword: 'new password', | ||
245 | email: 'updated@example.com' | ||
246 | }) | ||
247 | |||
248 | const user = await server.users.getMyInfo({ token: userToken }) | ||
249 | expect(user.username).to.equal('user_1') | ||
250 | expect(user.email).to.equal('updated@example.com') | ||
251 | expect(user.nsfwPolicy).to.equal('do_not_list') | ||
252 | expect(user.videoQuota).to.equal(2 * 1024 * 1024) | ||
253 | expect(user.id).to.be.a('number') | ||
254 | expect(user.account.displayName).to.equal('user_1') | ||
255 | expect(user.account.description).to.be.null | ||
256 | }) | ||
257 | |||
258 | it('Should be able to update my avatar with a gif', async function () { | ||
259 | const fixture = 'avatar.gif' | ||
260 | |||
261 | await server.users.updateMyAvatar({ token: userToken, fixture }) | ||
262 | |||
263 | const user = await server.users.getMyInfo({ token: userToken }) | ||
264 | for (const avatar of user.account.avatars) { | ||
265 | await testImageSize(server.url, `avatar-resized-${avatar.width}x${avatar.width}`, avatar.path, '.gif') | ||
266 | } | ||
267 | }) | ||
268 | |||
269 | it('Should be able to update my avatar with a gif, and then a png', async function () { | ||
270 | for (const extension of [ '.png', '.gif' ]) { | ||
271 | const fixture = 'avatar' + extension | ||
272 | |||
273 | await server.users.updateMyAvatar({ token: userToken, fixture }) | ||
274 | |||
275 | const user = await server.users.getMyInfo({ token: userToken }) | ||
276 | for (const avatar of user.account.avatars) { | ||
277 | await testImageSize(server.url, `avatar-resized-${avatar.width}x${avatar.width}`, avatar.path, extension) | ||
278 | } | ||
279 | } | ||
280 | }) | ||
281 | |||
282 | it('Should be able to update my display name', async function () { | ||
283 | await server.users.updateMe({ token: userToken, displayName: 'new display name' }) | ||
284 | |||
285 | const user = await server.users.getMyInfo({ token: userToken }) | ||
286 | expect(user.username).to.equal('user_1') | ||
287 | expect(user.email).to.equal('updated@example.com') | ||
288 | expect(user.nsfwPolicy).to.equal('do_not_list') | ||
289 | expect(user.videoQuota).to.equal(2 * 1024 * 1024) | ||
290 | expect(user.id).to.be.a('number') | ||
291 | expect(user.account.displayName).to.equal('new display name') | ||
292 | expect(user.account.description).to.be.null | ||
293 | }) | ||
294 | |||
295 | it('Should be able to update my description', async function () { | ||
296 | await server.users.updateMe({ token: userToken, description: 'my super description updated' }) | ||
297 | |||
298 | const user = await server.users.getMyInfo({ token: userToken }) | ||
299 | expect(user.username).to.equal('user_1') | ||
300 | expect(user.email).to.equal('updated@example.com') | ||
301 | expect(user.nsfwPolicy).to.equal('do_not_list') | ||
302 | expect(user.videoQuota).to.equal(2 * 1024 * 1024) | ||
303 | expect(user.id).to.be.a('number') | ||
304 | expect(user.account.displayName).to.equal('new display name') | ||
305 | expect(user.account.description).to.equal('my super description updated') | ||
306 | expect(user.noWelcomeModal).to.be.false | ||
307 | expect(user.noInstanceConfigWarningModal).to.be.false | ||
308 | expect(user.noAccountSetupWarningModal).to.be.false | ||
309 | }) | ||
310 | |||
311 | it('Should be able to update my theme', async function () { | ||
312 | for (const theme of [ 'background-red', 'default', 'instance-default' ]) { | ||
313 | await server.users.updateMe({ token: userToken, theme }) | ||
314 | |||
315 | const user = await server.users.getMyInfo({ token: userToken }) | ||
316 | expect(user.theme).to.equal(theme) | ||
317 | } | ||
318 | }) | ||
319 | |||
320 | it('Should be able to update my modal preferences', async function () { | ||
321 | await server.users.updateMe({ | ||
322 | token: userToken, | ||
323 | noInstanceConfigWarningModal: true, | ||
324 | noWelcomeModal: true, | ||
325 | noAccountSetupWarningModal: true | ||
326 | }) | ||
327 | |||
328 | const user = await server.users.getMyInfo({ token: userToken }) | ||
329 | expect(user.noWelcomeModal).to.be.true | ||
330 | expect(user.noInstanceConfigWarningModal).to.be.true | ||
331 | expect(user.noAccountSetupWarningModal).to.be.true | ||
332 | }) | ||
333 | }) | ||
334 | |||
335 | describe('Updating another user', function () { | ||
336 | |||
337 | it('Should be able to update another user', async function () { | ||
338 | await server.users.update({ | ||
339 | userId, | ||
340 | token, | ||
341 | email: 'updated2@example.com', | ||
342 | emailVerified: true, | ||
343 | videoQuota: 42, | ||
344 | role: UserRole.MODERATOR, | ||
345 | adminFlags: UserAdminFlag.NONE, | ||
346 | pluginAuth: 'toto' | ||
347 | }) | ||
348 | |||
349 | const user = await server.users.get({ token, userId }) | ||
350 | |||
351 | expect(user.username).to.equal('user_1') | ||
352 | expect(user.email).to.equal('updated2@example.com') | ||
353 | expect(user.emailVerified).to.be.true | ||
354 | expect(user.nsfwPolicy).to.equal('do_not_list') | ||
355 | expect(user.videoQuota).to.equal(42) | ||
356 | expect(user.role.label).to.equal('Moderator') | ||
357 | expect(user.id).to.be.a('number') | ||
358 | expect(user.adminFlags).to.equal(UserAdminFlag.NONE) | ||
359 | expect(user.pluginAuth).to.equal('toto') | ||
360 | }) | ||
361 | |||
362 | it('Should reset the auth plugin', async function () { | ||
363 | await server.users.update({ userId, token, pluginAuth: null }) | ||
364 | |||
365 | const user = await server.users.get({ token, userId }) | ||
366 | expect(user.pluginAuth).to.be.null | ||
367 | }) | ||
368 | |||
369 | it('Should have removed the user token', async function () { | ||
370 | await server.users.getMyQuotaUsed({ token: userToken, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) | ||
371 | |||
372 | userToken = await server.login.getAccessToken(user) | ||
373 | }) | ||
374 | |||
375 | it('Should be able to update another user password', async function () { | ||
376 | await server.users.update({ userId, token, password: 'password updated' }) | ||
377 | |||
378 | await server.users.getMyQuotaUsed({ token: userToken, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) | ||
379 | |||
380 | await server.login.login({ user, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | ||
381 | |||
382 | user.password = 'password updated' | ||
383 | userToken = await server.login.getAccessToken(user) | ||
384 | }) | ||
385 | }) | ||
386 | |||
387 | describe('Remove a user', function () { | ||
388 | |||
389 | before(async function () { | ||
390 | await server.users.update({ | ||
391 | userId, | ||
392 | token, | ||
393 | videoQuota: 2 * 1024 * 1024 | ||
394 | }) | ||
395 | |||
396 | await server.videos.quickUpload({ name: 'user video', token: userToken, fixture: 'video_short.webm' }) | ||
397 | await server.videos.quickUpload({ name: 'root video' }) | ||
398 | |||
399 | const { total } = await server.videos.list() | ||
400 | expect(total).to.equal(2) | ||
401 | }) | ||
402 | |||
403 | it('Should be able to remove this user', async function () { | ||
404 | await server.users.remove({ userId, token }) | ||
405 | }) | ||
406 | |||
407 | it('Should not be able to login with this user', async function () { | ||
408 | await server.login.login({ user, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | ||
409 | }) | ||
410 | |||
411 | it('Should not have videos of this user', async function () { | ||
412 | const { data, total } = await server.videos.list() | ||
413 | expect(total).to.equal(1) | ||
414 | |||
415 | const video = data[0] | ||
416 | expect(video.account.name).to.equal('root') | ||
417 | }) | ||
418 | }) | ||
419 | |||
420 | describe('User blocking', function () { | ||
421 | let user16Id: number | ||
422 | let user16AccessToken: string | ||
423 | |||
424 | const user16 = { | ||
425 | username: 'user_16', | ||
426 | password: 'my super password' | ||
427 | } | ||
428 | |||
429 | it('Should block a user', async function () { | ||
430 | const user = await server.users.create({ ...user16 }) | ||
431 | user16Id = user.id | ||
432 | |||
433 | user16AccessToken = await server.login.getAccessToken(user16) | ||
434 | |||
435 | await server.users.getMyInfo({ token: user16AccessToken, expectedStatus: HttpStatusCode.OK_200 }) | ||
436 | await server.users.banUser({ userId: user16Id }) | ||
437 | |||
438 | await server.users.getMyInfo({ token: user16AccessToken, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) | ||
439 | await server.login.login({ user: user16, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | ||
440 | }) | ||
441 | |||
442 | it('Should search user by banned status', async function () { | ||
443 | { | ||
444 | const { data, total } = await server.users.list({ start: 0, count: 2, sort: 'createdAt', blocked: true }) | ||
445 | expect(total).to.equal(1) | ||
446 | expect(data.length).to.equal(1) | ||
447 | |||
448 | expect(data[0].username).to.equal(user16.username) | ||
449 | } | ||
450 | |||
451 | { | ||
452 | const { data, total } = await server.users.list({ start: 0, count: 2, sort: 'createdAt', blocked: false }) | ||
453 | expect(total).to.equal(1) | ||
454 | expect(data.length).to.equal(1) | ||
455 | |||
456 | expect(data[0].username).to.not.equal(user16.username) | ||
457 | } | ||
458 | }) | ||
459 | |||
460 | it('Should unblock a user', async function () { | ||
461 | await server.users.unbanUser({ userId: user16Id }) | ||
462 | user16AccessToken = await server.login.getAccessToken(user16) | ||
463 | await server.users.getMyInfo({ token: user16AccessToken, expectedStatus: HttpStatusCode.OK_200 }) | ||
464 | }) | ||
465 | }) | ||
466 | |||
467 | describe('User stats', function () { | ||
468 | let user17Id: number | ||
469 | let user17AccessToken: string | ||
470 | |||
471 | it('Should report correct initial statistics about a user', async function () { | ||
472 | const user17 = { | ||
473 | username: 'user_17', | ||
474 | password: 'my super password' | ||
475 | } | ||
476 | const created = await server.users.create({ ...user17 }) | ||
477 | |||
478 | user17Id = created.id | ||
479 | user17AccessToken = await server.login.getAccessToken(user17) | ||
480 | |||
481 | const user = await server.users.get({ userId: user17Id, withStats: true }) | ||
482 | expect(user.videosCount).to.equal(0) | ||
483 | expect(user.videoCommentsCount).to.equal(0) | ||
484 | expect(user.abusesCount).to.equal(0) | ||
485 | expect(user.abusesCreatedCount).to.equal(0) | ||
486 | expect(user.abusesAcceptedCount).to.equal(0) | ||
487 | }) | ||
488 | |||
489 | it('Should report correct videos count', async function () { | ||
490 | const attributes = { name: 'video to test user stats' } | ||
491 | await server.videos.upload({ token: user17AccessToken, attributes }) | ||
492 | |||
493 | const { data } = await server.videos.list() | ||
494 | videoId = data.find(video => video.name === attributes.name).id | ||
495 | |||
496 | const user = await server.users.get({ userId: user17Id, withStats: true }) | ||
497 | expect(user.videosCount).to.equal(1) | ||
498 | }) | ||
499 | |||
500 | it('Should report correct video comments for user', async function () { | ||
501 | const text = 'super comment' | ||
502 | await server.comments.createThread({ token: user17AccessToken, videoId, text }) | ||
503 | |||
504 | const user = await server.users.get({ userId: user17Id, withStats: true }) | ||
505 | expect(user.videoCommentsCount).to.equal(1) | ||
506 | }) | ||
507 | |||
508 | it('Should report correct abuses counts', async function () { | ||
509 | const reason = 'my super bad reason' | ||
510 | await server.abuses.report({ token: user17AccessToken, videoId, reason }) | ||
511 | |||
512 | const body1 = await server.abuses.getAdminList() | ||
513 | const abuseId = body1.data[0].id | ||
514 | |||
515 | const user2 = await server.users.get({ userId: user17Id, withStats: true }) | ||
516 | expect(user2.abusesCount).to.equal(1) // number of incriminations | ||
517 | expect(user2.abusesCreatedCount).to.equal(1) // number of reports created | ||
518 | |||
519 | await server.abuses.update({ abuseId, body: { state: AbuseState.ACCEPTED } }) | ||
520 | |||
521 | const user3 = await server.users.get({ userId: user17Id, withStats: true }) | ||
522 | expect(user3.abusesAcceptedCount).to.equal(1) // number of reports created accepted | ||
523 | }) | ||
524 | }) | ||
525 | |||
526 | after(async function () { | ||
527 | await cleanupTests([ server ]) | ||
528 | }) | ||
529 | }) | ||