]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/views.ts
Fix fast restream in saved permanent live
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / views.ts
index 3dba2a42e59dbb151eac3118a0fbca491698d53c..8f1fa796bc1487db334fbce5c0e6e20c33a7320d 100644 (file)
@@ -75,8 +75,30 @@ describe('Test videos views', function () {
       })
     })
 
+    it('Should fail with an invalid start date', async function () {
+      await servers[0].videoStats.getOverallStats({
+        videoId,
+        startDate: 'fake' as any,
+        endDate: new Date().toISOString(),
+        expectedStatus: HttpStatusCode.BAD_REQUEST_400
+      })
+    })
+
+    it('Should fail with an invalid end date', async function () {
+      await servers[0].videoStats.getOverallStats({
+        videoId,
+        startDate: new Date().toISOString(),
+        endDate: 'fake' as any,
+        expectedStatus: HttpStatusCode.BAD_REQUEST_400
+      })
+    })
+
     it('Should succeed with the correct parameters', async function () {
-      await servers[0].videoStats.getOverallStats({ videoId })
+      await servers[0].videoStats.getOverallStats({
+        videoId,
+        startDate: new Date().toISOString(),
+        endDate: new Date().toISOString()
+      })
     })
   })
 
@@ -154,7 +176,7 @@ describe('Test videos views', function () {
       await servers[0].videoStats.getTimeserieStats({
         videoId,
         metric: 'viewers',
-        startDate: new Date('2021-04-07T08:31:57.126Z'),
+        startDate: new Date('2000-04-07T08:31:57.126Z'),
         endDate: new Date(),
         expectedStatus: HttpStatusCode.BAD_REQUEST_400
       })