aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/views.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-05-05 14:12:57 +0200
committerChocobozzz <me@florianbigard.com>2022-05-05 14:13:14 +0200
commit49f0468d44468528c2fb2c8b0efd19cdaeeec43d (patch)
tree4fd07d5da74506729a1cbbe67548bfd9c6c76849 /server/tests/api/check-params/views.ts
parentf18a060a83d7053897173b2a24fb7984893131c7 (diff)
downloadPeerTube-49f0468d44468528c2fb2c8b0efd19cdaeeec43d.tar.gz
PeerTube-49f0468d44468528c2fb2c8b0efd19cdaeeec43d.tar.zst
PeerTube-49f0468d44468528c2fb2c8b0efd19cdaeeec43d.zip
Add filter by start/end date overall stats in api
Diffstat (limited to 'server/tests/api/check-params/views.ts')
-rw-r--r--server/tests/api/check-params/views.ts24
1 files changed, 23 insertions, 1 deletions
diff --git a/server/tests/api/check-params/views.ts b/server/tests/api/check-params/views.ts
index 3dba2a42e..fe037b145 100644
--- a/server/tests/api/check-params/views.ts
+++ b/server/tests/api/check-params/views.ts
@@ -75,8 +75,30 @@ describe('Test videos views', function () {
75 }) 75 })
76 }) 76 })
77 77
78 it('Should fail with an invalid start date', async function () {
79 await servers[0].videoStats.getOverallStats({
80 videoId,
81 startDate: 'fake' as any,
82 endDate: new Date().toISOString(),
83 expectedStatus: HttpStatusCode.BAD_REQUEST_400
84 })
85 })
86
87 it('Should fail with an invalid end date', async function () {
88 await servers[0].videoStats.getOverallStats({
89 videoId,
90 startDate: new Date().toISOString(),
91 endDate: 'fake' as any,
92 expectedStatus: HttpStatusCode.BAD_REQUEST_400
93 })
94 })
95
78 it('Should succeed with the correct parameters', async function () { 96 it('Should succeed with the correct parameters', async function () {
79 await servers[0].videoStats.getOverallStats({ videoId }) 97 await servers[0].videoStats.getOverallStats({
98 videoId,
99 startDate: new Date().toISOString(),
100 endDate: new Date().toISOString()
101 })
80 }) 102 })
81 }) 103 })
82 104