aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/moderation
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-17 15:25:58 +0200
committerChocobozzz <me@florianbigard.com>2022-08-17 15:25:58 +0200
commitbbd5aa7ead5f1554a0872963f957effc26d8c630 (patch)
treea32cad420cfabe4eab5df4e3f104fa34f734fa7d /server/tests/api/moderation
parenta85d530384761a0af833caac9b38b9834517c9fa (diff)
downloadPeerTube-bbd5aa7ead5f1554a0872963f957effc26d8c630.tar.gz
PeerTube-bbd5aa7ead5f1554a0872963f957effc26d8c630.tar.zst
PeerTube-bbd5aa7ead5f1554a0872963f957effc26d8c630.zip
Reimplement a typed omit function
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 })