mirror of https://github.com/Chocobozzz/PeerTube
Fix config test with parallel tests
parent
81963e0c6e
commit
7eb0189b73
|
@ -56,7 +56,7 @@ function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) {
|
|||
expect(data.signup.requiresApproval).to.be.false
|
||||
expect(data.signup.requiresEmailVerification).to.be.false
|
||||
|
||||
expect(data.admin.email).to.equal('admin' + server.internalServerNumber + '@example.com')
|
||||
expect(data.admin.email).to.equal(`admin${server.internalServerNumber}@example.com`)
|
||||
expect(data.contactForm.enabled).to.be.true
|
||||
|
||||
expect(data.user.history.videos.enabled).to.be.true
|
||||
|
@ -136,7 +136,8 @@ function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) {
|
|||
expect(data.export.users.maxUserVideoQuota).to.equal(10737418240)
|
||||
}
|
||||
|
||||
const newCustomConfig: CustomConfig = {
|
||||
function buildNewCustomConfig (server: PeerTubeServer): CustomConfig {
|
||||
return {
|
||||
instance: {
|
||||
name: 'PeerTube updated',
|
||||
shortDescription: 'my short description',
|
||||
|
@ -206,7 +207,7 @@ const newCustomConfig: CustomConfig = {
|
|||
minimumAge: 10
|
||||
},
|
||||
admin: {
|
||||
email: 'superadmin1@example.com'
|
||||
email: `admin${server.internalServerNumber}@example.com`
|
||||
},
|
||||
contactForm: {
|
||||
enabled: false
|
||||
|
@ -374,10 +375,11 @@ const newCustomConfig: CustomConfig = {
|
|||
maxUserVideoQuota: 42
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
describe('Test static config', function () {
|
||||
let server: PeerTubeServer = null
|
||||
let server: PeerTubeServer
|
||||
|
||||
before(async function () {
|
||||
this.timeout(30000)
|
||||
|
@ -393,7 +395,7 @@ describe('Test static config', function () {
|
|||
})
|
||||
|
||||
it('Should error when client tries to update', async function () {
|
||||
await server.config.updateCustomConfig({ newCustomConfig, expectedStatus: 405 })
|
||||
await server.config.updateCustomConfig({ newCustomConfig: buildNewCustomConfig(server), expectedStatus: 405 })
|
||||
})
|
||||
|
||||
after(async function () {
|
||||
|
@ -464,10 +466,10 @@ describe('Test config', function () {
|
|||
})
|
||||
|
||||
it('Should update the customized configuration', async function () {
|
||||
await server.config.updateCustomConfig({ newCustomConfig })
|
||||
await server.config.updateCustomConfig({ newCustomConfig: buildNewCustomConfig(server) })
|
||||
|
||||
const data = await server.config.getCustomConfig()
|
||||
expect(data).to.deep.equal(newCustomConfig)
|
||||
expect(data).to.deep.equal(buildNewCustomConfig(server))
|
||||
})
|
||||
|
||||
it('Should have the correct updated video allowed extensions', async function () {
|
||||
|
@ -499,7 +501,7 @@ describe('Test config', function () {
|
|||
|
||||
const data = await server.config.getCustomConfig()
|
||||
|
||||
expect(data).to.deep.equal(newCustomConfig)
|
||||
expect(data).to.deep.equal(buildNewCustomConfig(server))
|
||||
})
|
||||
|
||||
it('Should fetch the about information', async function () {
|
||||
|
|
Loading…
Reference in New Issue