aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/moderation
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/moderation')
-rw-r--r--server/tests/api/moderation/video-blacklist.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/tests/api/moderation/video-blacklist.ts b/server/tests/api/moderation/video-blacklist.ts
index 1790210ff..a7620b071 100644
--- a/server/tests/api/moderation/video-blacklist.ts
+++ b/server/tests/api/moderation/video-blacklist.ts
@@ -2,8 +2,8 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { orderBy } from 'lodash'
6import { FIXTURE_URLS } from '@server/tests/shared' 5import { FIXTURE_URLS } from '@server/tests/shared'
6import { sortObjectComparator } from '@shared/core-utils'
7import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models' 7import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models'
8import { 8import {
9 BlacklistCommand, 9 BlacklistCommand,
@@ -138,7 +138,7 @@ describe('Test video blacklist', function () {
138 expect(blacklistedVideos).to.be.an('array') 138 expect(blacklistedVideos).to.be.an('array')
139 expect(blacklistedVideos.length).to.equal(2) 139 expect(blacklistedVideos.length).to.equal(2)
140 140
141 const result = orderBy(body.data, [ 'id' ], [ 'desc' ]) 141 const result = [ ...body.data ].sort(sortObjectComparator('id', 'desc'))
142 expect(blacklistedVideos).to.deep.equal(result) 142 expect(blacklistedVideos).to.deep.equal(result)
143 }) 143 })
144 144
@@ -150,7 +150,7 @@ describe('Test video blacklist', function () {
150 expect(blacklistedVideos).to.be.an('array') 150 expect(blacklistedVideos).to.be.an('array')
151 expect(blacklistedVideos.length).to.equal(2) 151 expect(blacklistedVideos.length).to.equal(2)
152 152
153 const result = orderBy(body.data, [ 'name' ], [ 'desc' ]) 153 const result = [ ...body.data ].sort(sortObjectComparator('name', 'desc'))
154 expect(blacklistedVideos).to.deep.equal(result) 154 expect(blacklistedVideos).to.deep.equal(result)
155 }) 155 })
156 156
@@ -162,7 +162,7 @@ describe('Test video blacklist', function () {
162 expect(blacklistedVideos).to.be.an('array') 162 expect(blacklistedVideos).to.be.an('array')
163 expect(blacklistedVideos.length).to.equal(2) 163 expect(blacklistedVideos.length).to.equal(2)
164 164
165 const result = orderBy(body.data, [ 'createdAt' ]) 165 const result = [ ...body.data ].sort(sortObjectComparator('createdAt', 'asc'))
166 expect(blacklistedVideos).to.deep.equal(result) 166 expect(blacklistedVideos).to.deep.equal(result)
167 }) 167 })
168 }) 168 })