aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/video-channels.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-03-27 22:26:39 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-03-31 10:29:24 +0200
commit714bfcc556177dce2b65a1e58babdf2488e9de13 (patch)
tree35d5d14c03756bc239ce91d52ca9051dd34f80c4 /shared/extra-utils/videos/video-channels.ts
parent747c562837e37f2fa455e8ef62165e9bb4e365f1 (diff)
downloadPeerTube-714bfcc556177dce2b65a1e58babdf2488e9de13.tar.gz
PeerTube-714bfcc556177dce2b65a1e58babdf2488e9de13.tar.zst
PeerTube-714bfcc556177dce2b65a1e58babdf2488e9de13.zip
Tests for viewsPerDay
Diffstat (limited to 'shared/extra-utils/videos/video-channels.ts')
-rw-r--r--shared/extra-utils/videos/video-channels.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/shared/extra-utils/videos/video-channels.ts b/shared/extra-utils/videos/video-channels.ts
index 51d433940..55f08b996 100644
--- a/shared/extra-utils/videos/video-channels.ts
+++ b/shared/extra-utils/videos/video-channels.ts
@@ -8,7 +8,7 @@ import { ServerInfo } from '../server/servers'
8import { User } from '../../models/users/user.model' 8import { User } from '../../models/users/user.model'
9import { getMyUserInformation } from '../users/users' 9import { getMyUserInformation } from '../users/users'
10 10
11function getVideoChannelsList (url: string, start: number, count: number, sort?: string) { 11function getVideoChannelsList (url: string, start: number, count: number, sort?: string, withStats?: boolean) {
12 const path = '/api/v1/video-channels' 12 const path = '/api/v1/video-channels'
13 13
14 const req = request(url) 14 const req = request(url)
@@ -17,6 +17,7 @@ function getVideoChannelsList (url: string, start: number, count: number, sort?:
17 .query({ count: count }) 17 .query({ count: count })
18 18
19 if (sort) req.query({ sort }) 19 if (sort) req.query({ sort })
20 if (withStats) req.query({ withStats })
20 21
21 return req.set('Accept', 'application/json') 22 return req.set('Accept', 'application/json')
22 .expect(200) 23 .expect(200)
@@ -30,8 +31,9 @@ function getAccountVideoChannelsList (parameters: {
30 count?: number 31 count?: number
31 sort?: string 32 sort?: string
32 specialStatus?: number 33 specialStatus?: number
34 withStats?: boolean
33}) { 35}) {
34 const { url, accountName, start, count, sort = 'createdAt', specialStatus = 200 } = parameters 36 const { url, accountName, start, count, sort = 'createdAt', specialStatus = 200, withStats = false } = parameters
35 37
36 const path = '/api/v1/accounts/' + accountName + '/video-channels' 38 const path = '/api/v1/accounts/' + accountName + '/video-channels'
37 39
@@ -41,7 +43,8 @@ function getAccountVideoChannelsList (parameters: {
41 query: { 43 query: {
42 start, 44 start,
43 count, 45 count,
44 sort 46 sort,
47 withStats
45 }, 48 },
46 statusCodeExpected: specialStatus 49 statusCodeExpected: specialStatus
47 }) 50 })