X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fserver%2Fconfig.ts;h=ca389b7b6b64c126d249464809024556ddfa0127;hb=bec4ea343987c69252b84d02f444c0f033d4a3f9;hp=c0d11914bf2d047557c1c57b68701b498500d8ce;hpb=7c3b79768bd174b22154e8d2df0b1211e01ee56a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index c0d11914b..ca389b7b6 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts @@ -11,9 +11,9 @@ import { getAbout, getConfig, getCustomConfig, - killallServers, + killallServers, parallelTests, registerUser, - reRunServer, + reRunServer, ServerInfo, setAccessTokensToServers, updateCustomConfig } from '../../../../shared/extra-utils' @@ -21,7 +21,7 @@ import { ServerConfig } from '../../../../shared/models' const expect = chai.expect -function checkInitialConfig (data: CustomConfig) { +function checkInitialConfig (server: ServerInfo, data: CustomConfig) { expect(data.instance.name).to.equal('PeerTube') expect(data.instance.shortDescription).to.equal( 'PeerTube, a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser ' + @@ -45,7 +45,7 @@ function checkInitialConfig (data: CustomConfig) { expect(data.signup.limit).to.equal(4) expect(data.signup.requiresEmailVerification).to.be.false - expect(data.admin.email).to.equal('admin1@example.com') + expect(data.admin.email).to.equal('admin' + server.internalServerNumber + '@example.com') expect(data.contactForm.enabled).to.be.true expect(data.user.videoQuota).to.equal(5242880) @@ -89,7 +89,11 @@ function checkUpdatedConfig (data: CustomConfig) { expect(data.signup.limit).to.equal(5) expect(data.signup.requiresEmailVerification).to.be.false - expect(data.admin.email).to.equal('superadmin1@example.com') + // We override admin email in parallel tests, so skip this exception + if (parallelTests() === false) { + expect(data.admin.email).to.equal('superadmin1@example.com') + } + expect(data.contactForm.enabled).to.be.false expect(data.user.videoQuota).to.equal(5242881) @@ -118,6 +122,7 @@ describe('Test config', function () { before(async function () { this.timeout(30000) + server = await flushAndRunServer(1) await setAccessTokensToServers([ server ]) }) @@ -160,7 +165,7 @@ describe('Test config', function () { const res = await getCustomConfig(server.url, server.accessToken) const data = res.body as CustomConfig - checkInitialConfig(data) + checkInitialConfig(server, data) }) it('Should update the customized configuration', async function () { @@ -297,7 +302,7 @@ describe('Test config', function () { const res = await getCustomConfig(server.url, server.accessToken) const data = res.body - checkInitialConfig(data) + checkInitialConfig(server, data) }) after(async function () {