From bbd5aa7ead5f1554a0872963f957effc26d8c630 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 17 Aug 2022 15:25:58 +0200 Subject: Reimplement a typed omit function --- server/tests/api/moderation/video-blacklist.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server/tests/api/moderation/video-blacklist.ts') 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 @@ import 'mocha' import * as chai from 'chai' -import { orderBy } from 'lodash' import { FIXTURE_URLS } from '@server/tests/shared' +import { sortObjectComparator } from '@shared/core-utils' import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models' import { BlacklistCommand, @@ -138,7 +138,7 @@ describe('Test video blacklist', function () { expect(blacklistedVideos).to.be.an('array') expect(blacklistedVideos.length).to.equal(2) - const result = orderBy(body.data, [ 'id' ], [ 'desc' ]) + const result = [ ...body.data ].sort(sortObjectComparator('id', 'desc')) expect(blacklistedVideos).to.deep.equal(result) }) @@ -150,7 +150,7 @@ describe('Test video blacklist', function () { expect(blacklistedVideos).to.be.an('array') expect(blacklistedVideos.length).to.equal(2) - const result = orderBy(body.data, [ 'name' ], [ 'desc' ]) + const result = [ ...body.data ].sort(sortObjectComparator('name', 'desc')) expect(blacklistedVideos).to.deep.equal(result) }) @@ -162,7 +162,7 @@ describe('Test video blacklist', function () { expect(blacklistedVideos).to.be.an('array') expect(blacklistedVideos.length).to.equal(2) - const result = orderBy(body.data, [ 'createdAt' ]) + const result = [ ...body.data ].sort(sortObjectComparator('createdAt', 'asc')) expect(blacklistedVideos).to.deep.equal(result) }) }) -- cgit v1.2.3