X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Futils%2Fvideos.ts;h=73a9f1a0abbc6024cecf2494d6cce3ab10eed1a2;hb=1b5b10d13152d704d2396a1e53d56aba1a8e7e03;hp=dababe9249e9c87c5d83a48cfb8fff9b8e521bc6;hpb=d4f1e94c89336255537b0b82913591f00e716201;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/utils/videos.ts b/server/tests/utils/videos.ts index dababe924..73a9f1a0a 100644 --- a/server/tests/utils/videos.ts +++ b/server/tests/utils/videos.ts @@ -55,6 +55,15 @@ function getVideo (url: string, id: number | string, expectedStatus = 200) { .expect(expectedStatus) } +function viewVideo (url: string, id: number | string, expectedStatus = 204) { + const path = '/api/v1/videos/' + id + '/views' + + return request(url) + .post(path) + .set('Accept', 'application/json') + .expect(expectedStatus) +} + function getVideoWithToken (url: string, token: string, id: number | string, expectedStatus = 200) { const path = '/api/v1/videos/' + id @@ -313,5 +322,6 @@ export { uploadVideo, updateVideo, rateVideo, + viewVideo, parseTorrentVideo }