X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-privacy.ts;h=1073aee8c48a538527665beecc7448c09c3dcae9;hb=0567049a9819d67070aa6d548a75a7e632a4aaa4;hp=de08a9e7b6f8e5c1e1fc6bfa95071bcdd15149e4;hpb=89d241a79c262b9775c233b73cff080043ebb5e6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-privacy.ts b/server/tests/api/videos/video-privacy.ts index de08a9e7b..1073aee8c 100644 --- a/server/tests/api/videos/video-privacy.ts +++ b/server/tests/api/videos/video-privacy.ts @@ -2,14 +2,14 @@ import 'mocha' import * as chai from 'chai' -import { HttpStatusCode } from '@shared/core-utils' -import { cleanupTests, doubleFollow, flushAndRunServer, ServerInfo, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' -import { VideoCreateResult, VideoPrivacy } from '@shared/models' +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: ServerInfo[] = [] + const servers: PeerTubeServer[] = [] let anotherUserToken: string let privateVideoId: number @@ -35,8 +35,8 @@ describe('Test video privacy', function () { this.timeout(50000) // Run servers - servers.push(await flushAndRunServer(1, dontFederateUnlistedConfig)) - servers.push(await flushAndRunServer(2)) + servers.push(await createSingleServer(1, dontFederateUnlistedConfig)) + servers.push(await createSingleServer(2)) // Get the access tokens await setAccessTokensToServers(servers) @@ -162,7 +162,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.BAD_REQUEST_400 }) + 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 () { @@ -210,7 +210,7 @@ describe('Test video privacy', function () { describe('Privacy update', function () { it('Should update the private and internal videos to public on server 1', async function () { - this.timeout(10000) + this.timeout(100000) now = Date.now() @@ -231,6 +231,7 @@ describe('Test video privacy', function () { await servers[0].videos.update({ id: internalVideoId, attributes }) } + await wait(10000) await waitJobs(servers) })