]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-privacy.ts
Add ability to remove hls/webtorrent files
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-privacy.ts
index de08a9e7b6f8e5c1e1fc6bfa95071bcdd15149e4..b51b3bcddb58507e4fbf8ded8e3435be50c3c1cc 100644 (file)
@@ -2,14 +2,13 @@
 
 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 { cleanupTests, createSingleServer, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
+import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'
 
 const expect = chai.expect
 
 describe('Test video privacy', function () {
-  const servers: ServerInfo[] = []
+  const servers: PeerTubeServer[] = []
   let anotherUserToken: string
 
   let privateVideoId: number
@@ -35,8 +34,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 +161,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.NOT_FOUND_404 })
     })
 
     it('Should be able to get this unlisted video using its uuid/shortUUID', async function () {