diff options
Diffstat (limited to 'server/tests/client.ts')
-rw-r--r-- | server/tests/client.ts | 58 |
1 files changed, 13 insertions, 45 deletions
diff --git a/server/tests/client.ts b/server/tests/client.ts index bcbac86e9..b33a653b1 100644 --- a/server/tests/client.ts +++ b/server/tests/client.ts | |||
@@ -3,17 +3,21 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import * as request from 'supertest' | 5 | import * as request from 'supertest' |
6 | const expect = chai.expect | ||
7 | |||
8 | import { | 6 | import { |
9 | ServerInfo, | ||
10 | flushTests, | 7 | flushTests, |
8 | getCustomConfig, | ||
9 | getVideosList, | ||
10 | killallServers, | ||
11 | makeHTMLRequest, | ||
11 | runServer, | 12 | runServer, |
13 | ServerInfo, | ||
12 | serverLogin, | 14 | serverLogin, |
13 | uploadVideo, | 15 | updateCustomConfig, |
14 | getVideosList, updateCustomConfig, getCustomConfig, killallServers, makeHTMLRequest | 16 | updateCustomSubConfig, |
17 | uploadVideo | ||
15 | } from './utils' | 18 | } from './utils' |
16 | import { CustomConfig } from '../../shared/models/server/custom-config.model' | 19 | |
20 | const expect = chai.expect | ||
17 | 21 | ||
18 | function checkIndexTags (html: string, title: string, description: string, css: string) { | 22 | function checkIndexTags (html: string, title: string, description: string, css: string) { |
19 | expect(html).to.contain('<title>' + title + '</title>') | 23 | expect(html).to.contain('<title>' + title + '</title>') |
@@ -117,56 +121,20 @@ describe('Test a client controllers', function () { | |||
117 | }) | 121 | }) |
118 | 122 | ||
119 | it('Should update the customized configuration and have the correct index html tags', async function () { | 123 | it('Should update the customized configuration and have the correct index html tags', async function () { |
120 | const newCustomConfig: CustomConfig = { | 124 | await updateCustomSubConfig(server.url, server.accessToken, { |
121 | instance: { | 125 | instance: { |
122 | name: 'PeerTube updated', | 126 | name: 'PeerTube updated', |
123 | shortDescription: 'my short description', | 127 | shortDescription: 'my short description', |
124 | description: 'my super description', | 128 | description: 'my super description', |
125 | terms: 'my super terms', | 129 | terms: 'my super terms', |
126 | defaultClientRoute: '/videos/recently-added', | 130 | defaultClientRoute: '/videos/recently-added', |
127 | defaultNSFWPolicy: 'blur' as 'blur', | 131 | defaultNSFWPolicy: 'blur', |
128 | customizations: { | 132 | customizations: { |
129 | javascript: 'alert("coucou")', | 133 | javascript: 'alert("coucou")', |
130 | css: 'body { background-color: red; }' | 134 | css: 'body { background-color: red; }' |
131 | } | 135 | } |
132 | }, | ||
133 | services: { | ||
134 | twitter: { | ||
135 | username: '@Kuja', | ||
136 | whitelisted: true | ||
137 | } | ||
138 | }, | ||
139 | cache: { | ||
140 | previews: { | ||
141 | size: 2 | ||
142 | }, | ||
143 | captions: { | ||
144 | size: 3 | ||
145 | } | ||
146 | }, | ||
147 | signup: { | ||
148 | enabled: false, | ||
149 | limit: 5 | ||
150 | }, | ||
151 | admin: { | ||
152 | email: 'superadmin1@example.com' | ||
153 | }, | ||
154 | user: { | ||
155 | videoQuota: 5242881 | ||
156 | }, | ||
157 | transcoding: { | ||
158 | enabled: true, | ||
159 | threads: 1, | ||
160 | resolutions: { | ||
161 | '240p': false, | ||
162 | '360p': true, | ||
163 | '480p': true, | ||
164 | '720p': false, | ||
165 | '1080p': false | ||
166 | } | ||
167 | } | 136 | } |
168 | } | 137 | }) |
169 | await updateCustomConfig(server.url, server.accessToken, newCustomConfig) | ||
170 | 138 | ||
171 | const res = await makeHTMLRequest(server.url, '/videos/trending') | 139 | const res = await makeHTMLRequest(server.url, '/videos/trending') |
172 | 140 | ||