diff options
Diffstat (limited to 'server/tests/utils')
-rw-r--r-- | server/tests/utils/videos/video-channels.ts | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/server/tests/utils/videos/video-channels.ts b/server/tests/utils/videos/video-channels.ts index 978e21b19..021c4c420 100644 --- a/server/tests/utils/videos/video-channels.ts +++ b/server/tests/utils/videos/video-channels.ts | |||
@@ -1,10 +1,5 @@ | |||
1 | import * as request from 'supertest' | 1 | import * as request from 'supertest' |
2 | 2 | import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared/models/videos' | |
3 | type VideoChannelAttributes = { | ||
4 | name?: string | ||
5 | description?: string | ||
6 | support?: string | ||
7 | } | ||
8 | 3 | ||
9 | function getVideoChannelsList (url: string, start: number, count: number, sort?: string) { | 4 | function getVideoChannelsList (url: string, start: number, count: number, sort?: string) { |
10 | const path = '/api/v1/video-channels' | 5 | const path = '/api/v1/video-channels' |
@@ -34,14 +29,14 @@ function getAccountVideoChannelsList (url: string, accountId: number | string, s | |||
34 | function addVideoChannel ( | 29 | function addVideoChannel ( |
35 | url: string, | 30 | url: string, |
36 | token: string, | 31 | token: string, |
37 | videoChannelAttributesArg: VideoChannelAttributes, | 32 | videoChannelAttributesArg: VideoChannelCreate, |
38 | expectedStatus = 200 | 33 | expectedStatus = 200 |
39 | ) { | 34 | ) { |
40 | const path = '/api/v1/video-channels/' | 35 | const path = '/api/v1/video-channels/' |
41 | 36 | ||
42 | // Default attributes | 37 | // Default attributes |
43 | let attributes = { | 38 | let attributes = { |
44 | name: 'my super video channel', | 39 | displayName: 'my super video channel', |
45 | description: 'my super channel description', | 40 | description: 'my super channel description', |
46 | support: 'my super channel support' | 41 | support: 'my super channel support' |
47 | } | 42 | } |
@@ -59,13 +54,13 @@ function updateVideoChannel ( | |||
59 | url: string, | 54 | url: string, |
60 | token: string, | 55 | token: string, |
61 | channelId: number | string, | 56 | channelId: number | string, |
62 | attributes: VideoChannelAttributes, | 57 | attributes: VideoChannelUpdate, |
63 | expectedStatus = 204 | 58 | expectedStatus = 204 |
64 | ) { | 59 | ) { |
65 | const body = {} | 60 | const body = {} |
66 | const path = '/api/v1/video-channels/' + channelId | 61 | const path = '/api/v1/video-channels/' + channelId |
67 | 62 | ||
68 | if (attributes.name) body['name'] = attributes.name | 63 | if (attributes.displayName) body['displayName'] = attributes.displayName |
69 | if (attributes.description) body['description'] = attributes.description | 64 | if (attributes.description) body['description'] = attributes.description |
70 | if (attributes.support) body['support'] = attributes.support | 65 | if (attributes.support) body['support'] = attributes.support |
71 | 66 | ||