]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/live/live-permanent.ts
Merge branch 'release/4.2.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / live / live-permanent.ts
index c2392603b2ea39861644d86a1fe8850e861973d6..92eac9e5f4d3c51bd564bb5a9e6cd0e4b77db1be 100644 (file)
@@ -121,7 +121,7 @@ describe('Permanent live', function () {
     await waitJobs(servers)
   })
 
-  it('Should not have cleaned up this live', async function () {
+  it('Should have cleaned up this live', async function () {
     this.timeout(40000)
 
     await wait(5000)
@@ -129,7 +129,8 @@ describe('Permanent live', function () {
 
     for (const server of servers) {
       const videoDetails = await server.videos.get({ id: videoUUID })
-      expect(videoDetails.streamingPlaylists).to.have.lengthOf(1)
+
+      expect(videoDetails.streamingPlaylists).to.have.lengthOf(0)
     }
   })
 
@@ -140,7 +141,7 @@ describe('Permanent live', function () {
   })
 
   it('Should be able to stream again in the permanent live', async function () {
-    this.timeout(20000)
+    this.timeout(60000)
 
     await servers[0].config.updateCustomSubConfig({
       newConfig: {
@@ -171,6 +172,23 @@ describe('Permanent live', function () {
     await stopFfmpeg(ffmpegCommand)
   })
 
+  it('Should have appropriate sessions', async function () {
+    this.timeout(60000)
+
+    await servers[0].live.waitUntilWaiting({ videoId: videoUUID })
+
+    const { data, total } = await servers[0].live.listSessions({ videoId: videoUUID })
+    expect(total).to.equal(2)
+    expect(data).to.have.lengthOf(2)
+
+    for (const session of data) {
+      expect(session.startDate).to.exist
+      expect(session.endDate).to.exist
+
+      expect(session.error).to.not.exist
+    }
+  })
+
   after(async function () {
     await cleanupTests(servers)
   })