diff options
Diffstat (limited to 'server/tests/api/check-params/views.ts')
-rw-r--r-- | server/tests/api/check-params/views.ts | 24 |
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 | ||