From 44df2c31ec7f79e042ba26d43977b770e9a90b7b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 4 Nov 2024 11:01:02 +0100 Subject: [PATCH] Fix tests --- packages/tests/src/plugins/filter-hooks.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/tests/src/plugins/filter-hooks.ts b/packages/tests/src/plugins/filter-hooks.ts index d58eff51b..497fbcc9f 100644 --- a/packages/tests/src/plugins/filter-hooks.ts +++ b/packages/tests/src/plugins/filter-hooks.ts @@ -202,13 +202,13 @@ describe('Test plugin filter hooks', function () { }) it('Should run filter:api.video.update-file.accept.result', async function () { - const res = await servers[0].videos.replaceSourceFile({ + const body = await servers[0].videos.replaceSourceFile({ videoId: videoUUID, fixture: 'video_short1.webm', completedExpectedStatus: HttpStatusCode.FORBIDDEN_403 }) - expect((res as any)?.error).to.equal('no webm') + expect((body as PeerTubeProblemDocument)?.detail).to.equal('no webm') }) it('Should run filter:api.live-video.create.accept.result', async function () { @@ -499,7 +499,7 @@ describe('Test plugin filter hooks', function () { expectedStatus: HttpStatusCode.FORBIDDEN_403 }) - expect(res.body.error).to.equal('No jma 1') + expect((res.body as PeerTubeProblemDocument).detail).to.equal('No jma 1') }) }) @@ -556,7 +556,7 @@ describe('Test plugin filter hooks', function () { it('Should run filter:api.download.torrent.allowed.result', async function () { const res = await makeRawRequest({ url: downloadVideos[0].files[0].torrentDownloadUrl, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) - expect(res.body.error).to.equal('Liu Bei') + expect((res.body as PeerTubeProblemDocument).detail).to.equal('Liu Bei') await makeRawRequest({ url: downloadVideos[1].files[0].torrentDownloadUrl, expectedStatus: HttpStatusCode.OK_200 }) await makeRawRequest({ url: downloadVideos[2].files[0].torrentDownloadUrl, expectedStatus: HttpStatusCode.OK_200 }) @@ -571,7 +571,7 @@ describe('Test plugin filter hooks', function () { ] const res = await makeRawRequest({ url: refused, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) - expect(res.body.error).to.equal('Cao Cao') + expect((res.body as PeerTubeProblemDocument).detail).to.equal('Cao Cao') for (const url of allowed) { await makeRawRequest({ url, expectedStatus: HttpStatusCode.OK_200 }) @@ -590,7 +590,7 @@ describe('Test plugin filter hooks', function () { // Only streaming playlist is refuse const res = await makeRawRequest({ url: refused, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) - expect(res.body.error).to.equal('Sun Jian') + expect((res.body as PeerTubeProblemDocument).detail).to.equal('Sun Jian') // But not we there is a user in res await makeRawRequest({ url: refused, token: servers[0].accessToken, expectedStatus: HttpStatusCode.OK_200 })