X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-privacy.ts;h=de96bcfcc6609ddd7e5cfbb35394cb2782975a5e;hb=33b91e53d21fba295ecf516b717fb36e91990771;hp=3051a443d8eaae9d94d3bfc6875d5b677c6b1235;hpb=c3edc5b074aa4bb1861ed0a94d3713808e87170f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-privacy.ts b/server/tests/api/videos/video-privacy.ts index 3051a443d..de96bcfcc 100644 --- a/server/tests/api/videos/video-privacy.ts +++ b/server/tests/api/videos/video-privacy.ts @@ -1,13 +1,10 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import 'mocha' -import * as chai from 'chai' +import { expect } from 'chai' import { wait } from '@shared/core-utils' import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models' import { cleanupTests, createSingleServer, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' -const expect = chai.expect - describe('Test video privacy', function () { const servers: PeerTubeServer[] = [] let anotherUserToken: string @@ -48,7 +45,7 @@ describe('Test video privacy', function () { describe('Private and internal videos', function () { it('Should upload a private and internal videos on server 1', async function () { - this.timeout(10000) + this.timeout(50000) for (const privacy of [ VideoPrivacy.PRIVATE, VideoPrivacy.INTERNAL ]) { const attributes = { privacy } @@ -102,8 +99,6 @@ describe('Test video privacy', function () { }) it('Should not be able to watch the private video with another user', async function () { - this.timeout(10000) - const user = { username: 'hello', password: 'super password' @@ -131,7 +126,7 @@ describe('Test video privacy', function () { describe('Unlisted videos', function () { it('Should upload an unlisted video on server 2', async function () { - this.timeout(60000) + this.timeout(120000) const attributes = { name: 'unlisted video', @@ -162,7 +157,7 @@ describe('Test video privacy', function () { }) it('Should not be able to get this unlisted video using its id', async function () { - await servers[1].videos.get({ id: unlistedVideo.id, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) + await servers[1].videos.get({ id: unlistedVideo.id, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) }) it('Should be able to get this unlisted video using its uuid/shortUUID', async function () { @@ -257,8 +252,6 @@ describe('Test video privacy', function () { }) it('Should set these videos as private and internal', async function () { - this.timeout(10000) - await servers[0].videos.update({ id: internalVideoId, attributes: { privacy: VideoPrivacy.PRIVATE } }) await servers[0].videos.update({ id: privateVideoId, attributes: { privacy: VideoPrivacy.INTERNAL } })