X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fclient.ts;h=b33a653b13e2079f0bc6ef3980085fcb8fd347a5;hb=993cef4b6e000ee425087e5195dfe40cd0840243;hp=129b40cdf926b643fb6499c1d1a6ce0ac8e3f0b6;hpb=5d08a6a74e83f2e4dfe2f3ba7f5a39371e1bc89e;p=github%2FChocobozzz%2FPeerTube.git
diff --git a/server/tests/client.ts b/server/tests/client.ts
index 129b40cdf..b33a653b1 100644
--- a/server/tests/client.ts
+++ b/server/tests/client.ts
@@ -3,17 +3,21 @@
import 'mocha'
import * as chai from 'chai'
import * as request from 'supertest'
-const expect = chai.expect
-
import {
- ServerInfo,
flushTests,
+ getCustomConfig,
+ getVideosList,
+ killallServers,
+ makeHTMLRequest,
runServer,
+ ServerInfo,
serverLogin,
- uploadVideo,
- getVideosList, updateCustomConfig, getCustomConfig, killallServers, makeHTMLRequest
+ updateCustomConfig,
+ updateCustomSubConfig,
+ uploadVideo
} from './utils'
-import { CustomConfig } from '../../shared/models/server/custom-config.model'
+
+const expect = chai.expect
function checkIndexTags (html: string, title: string, description: string, css: string) {
expect(html).to.contain('
' + title + '')
@@ -117,63 +121,20 @@ describe('Test a client controllers', function () {
})
it('Should update the customized configuration and have the correct index html tags', async function () {
- const newCustomConfig: CustomConfig = {
+ await updateCustomSubConfig(server.url, server.accessToken, {
instance: {
name: 'PeerTube updated',
shortDescription: 'my short description',
description: 'my super description',
terms: 'my super terms',
defaultClientRoute: '/videos/recently-added',
- defaultNSFWPolicy: 'blur' as 'blur',
+ defaultNSFWPolicy: 'blur',
customizations: {
javascript: 'alert("coucou")',
css: 'body { background-color: red; }'
}
- },
- services: {
- twitter: {
- username: '@Kuja',
- whitelisted: true
- }
- },
- cache: {
- previews: {
- size: 2
- },
- captions: {
- size: 3
- }
- },
- signup: {
- enabled: false,
- limit: 5
- },
- admin: {
- email: 'superadmin1@example.com'
- },
- user: {
- videoQuota: 5242881
- },
- transcoding: {
- enabled: true,
- threads: 1,
- resolutions: {
- '240p': false,
- '360p': true,
- '480p': true,
- '720p': false,
- '1080p': false
- }
- },
- import: {
- videos: {
- http: {
- enabled: false
- }
- }
}
- }
- await updateCustomConfig(server.url, server.accessToken, newCustomConfig)
+ })
const res = await makeHTMLRequest(server.url, '/videos/trending')