X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fclient.ts;h=778dcd08e549f59176ca9c6efa7a516a0bc390eb;hb=e590b4a512617bbf63595b684386f68abea7d8b8;hp=bcbac86e9b9709a45cc94860d81faa66e485cf00;hpb=5bcfd02974389e1a131496d22f4321a79bed0fbb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/client.ts b/server/tests/client.ts index bcbac86e9..778dcd08e 100644 --- a/server/tests/client.ts +++ b/server/tests/client.ts @@ -3,17 +3,20 @@ import 'mocha' import * as chai from 'chai' import * as request from 'supertest' -const expect = chai.expect - import { + cleanupTests, + flushAndRunServer, + getCustomConfig, + getVideosList, + makeHTMLRequest, ServerInfo, - flushTests, - runServer, serverLogin, - uploadVideo, - getVideosList, updateCustomConfig, getCustomConfig, killallServers, makeHTMLRequest -} from './utils' -import { CustomConfig } from '../../shared/models/server/custom-config.model' + updateCustomConfig, + updateCustomSubConfig, + uploadVideo +} from '../../shared/extra-utils' + +const expect = chai.expect function checkIndexTags (html: string, title: string, description: string, css: string) { expect(html).to.contain('' + title + '') @@ -27,9 +30,7 @@ describe('Test a client controllers', function () { before(async function () { this.timeout(120000) - await flushTests() - - server = await runServer(1) + server = await flushAndRunServer(1) server.accessToken = await serverLogin(server) const videoAttributes = { @@ -117,56 +118,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 - } } - } - await updateCustomConfig(server.url, server.accessToken, newCustomConfig) + }) const res = await makeHTMLRequest(server.url, '/videos/trending') @@ -180,6 +145,6 @@ describe('Test a client controllers', function () { }) after(async function () { - killallServers([ server ]) + await cleanupTests([ server ]) }) })