From f41d6aacdf3b67e0c8d4e7a599b331d90aa607b7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Sep 2018 17:42:16 +0200 Subject: Fix jobs tests --- server/helpers/custom-validators/video-ownership.ts | 2 +- server/tests/api/server/jobs.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/helpers/custom-validators/video-ownership.ts b/server/helpers/custom-validators/video-ownership.ts index aaa0c736b..a7771e07b 100644 --- a/server/helpers/custom-validators/video-ownership.ts +++ b/server/helpers/custom-validators/video-ownership.ts @@ -31,7 +31,7 @@ export function checkUserCanTerminateOwnershipChange ( videoChangeOwnership: VideoChangeOwnershipModel, res: Response ): boolean { - if (videoChangeOwnership.NextOwner.userId === user.Account.userId) { + if (videoChangeOwnership.NextOwner.userId === user.id) { return true } diff --git a/server/tests/api/server/jobs.ts b/server/tests/api/server/jobs.ts index b2922c5da..f5a19c5ea 100644 --- a/server/tests/api/server/jobs.ts +++ b/server/tests/api/server/jobs.ts @@ -45,7 +45,9 @@ describe('Test jobs', function () { expect(res.body.total).to.be.above(2) expect(res.body.data).to.have.lengthOf(1) - const job = res.body.data[0] + let job = res.body.data[0] + // Skip repeat jobs + if (job.type === 'videos-views') job = res.body.data[1] expect(job.state).to.equal('completed') expect(job.type).to.equal('activitypub-follow') -- cgit v1.2.3