]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/live/live.ts
Support live session in server
[github/Chocobozzz/PeerTube.git] / server / tests / api / live / live.ts
index ab7251e312efee4ca6a6cea6cd2c7f82fc49b945..9b8fbe3e2433ca23b48576e4a45d863de197763f 100644 (file)
@@ -594,6 +594,8 @@ describe('Test live', function () {
 
     let permanentLiveReplayName: string
 
+    let beforeServerRestart: Date
+
     async function createLiveWrapper (options: { saveReplay: boolean, permanent: boolean }) {
       const liveAttributes: LiveVideoCreate = {
         name: 'live video',
@@ -636,6 +638,8 @@ describe('Test live', function () {
       }
 
       await killallServers([ servers[0] ])
+
+      beforeServerRestart = new Date()
       await servers[0].run()
 
       await wait(5000)
@@ -653,6 +657,10 @@ describe('Test live', function () {
       this.timeout(120000)
 
       await commands[0].waitUntilPublished({ videoId: liveVideoReplayId })
+
+      const session = await commands[0].getReplaySession({ videoId: liveVideoReplayId })
+      expect(session.endDate).to.exist
+      expect(new Date(session.endDate)).to.be.above(beforeServerRestart)
     })
 
     it('Should have saved a permanent live replay', async function () {