diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-03 16:23:45 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-06 11:19:16 +0200 |
commit | 590fb5069038e69898123bb795f789683216d837 (patch) | |
tree | ddb3d1830b7d64ebae214dd65a94dd3d16324819 /server/tests/client.ts | |
parent | 5d08a6a74e83f2e4dfe2f3ba7f5a39371e1bc89e (diff) | |
download | PeerTube-590fb5069038e69898123bb795f789683216d837.tar.gz PeerTube-590fb5069038e69898123bb795f789683216d837.tar.zst PeerTube-590fb5069038e69898123bb795f789683216d837.zip |
Add tests regarding video import
Diffstat (limited to 'server/tests/client.ts')
-rw-r--r-- | server/tests/client.ts | 69 |
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 @@ | |||
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,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 | ||