aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/client.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/client.ts')
-rw-r--r--server/tests/client.ts69
1 files changed, 12 insertions, 57 deletions
diff --git a/server/tests/client.ts b/server/tests/client.ts
index 129b40cdf..48f2ee4fc 100644
--- a/server/tests/client.ts
+++ b/server/tests/client.ts
@@ -3,17 +3,21 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import * as request from 'supertest' 5import * as request from 'supertest'
6const expect = chai.expect
7
8import { 6import {
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'
16import { CustomConfig } from '../../shared/models/server/custom-config.model' 19
20const expect = chai.expect
17 21
18function checkIndexTags (html: string, title: string, description: string, css: string) { 22function 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,63 +121,14 @@ 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',
123 shortDescription: 'my short description',
124 description: 'my super description',
125 terms: 'my super terms',
126 defaultClientRoute: '/videos/recently-added',
127 defaultNSFWPolicy: 'blur' as 'blur',
128 customizations: { 126 customizations: {
129 javascript: 'alert("coucou")', 127 javascript: 'alert("coucou")',
130 css: 'body { background-color: red; }' 128 css: 'body { background-color: red; }'
131 } 129 }
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 },
168 import: {
169 videos: {
170 http: {
171 enabled: false
172 }
173 }
174 } 130 }
175 } 131 })
176 await updateCustomConfig(server.url, server.accessToken, newCustomConfig)
177 132
178 const res = await makeHTMLRequest(server.url, '/videos/trending') 133 const res = await makeHTMLRequest(server.url, '/videos/trending')
179 134