]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/live/live-permanent.ts
Move typescript utils in its own directory
[github/Chocobozzz/PeerTube.git] / server / tests / api / live / live-permanent.ts
index 900bd6f5cbead78967f64fa64399bd1687da2151..c5f942901dc132ce01f8df222f6c12317eaa9f97 100644 (file)
@@ -6,9 +6,9 @@ import { LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models'
 import {
   cleanupTests,
   ConfigCommand,
+  createMultipleServers,
   doubleFollow,
-  flushAndRunMultipleServers,
-  ServerInfo,
+  PeerTubeServer,
   setAccessTokensToServers,
   setDefaultVideoChannel,
   stopFfmpeg,
@@ -19,7 +19,7 @@ import {
 const expect = chai.expect
 
 describe('Permanent live', function () {
-  let servers: ServerInfo[] = []
+  let servers: PeerTubeServer[] = []
   let videoUUID: string
 
   async function createLiveWrapper (permanentLive: boolean) {
@@ -45,7 +45,7 @@ describe('Permanent live', function () {
   before(async function () {
     this.timeout(120000)
 
-    servers = await flushAndRunMultipleServers(2)
+    servers = await createMultipleServers(2)
 
     // Get the access tokens
     await setAccessTokensToServers(servers)
@@ -101,6 +101,7 @@ describe('Permanent live', function () {
   it('Should stream into this permanent live', async function () {
     this.timeout(120000)
 
+    const beforePublication = new Date()
     const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: videoUUID })
 
     for (const server of servers) {
@@ -109,6 +110,11 @@ describe('Permanent live', function () {
 
     await checkVideoState(videoUUID, VideoState.PUBLISHED)
 
+    for (const server of servers) {
+      const video = await server.videos.get({ id: videoUUID })
+      expect(new Date(video.publishedAt)).greaterThan(beforePublication)
+    }
+
     await stopFfmpeg(ffmpegCommand)
     await servers[0].live.waitUntilWaiting({ videoId: videoUUID })