From 66b16cafb380012d3eca14e524d86f2450e04069 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 31 Jan 2018 16:42:40 +0100 Subject: Add new name/terms/description config options --- server/tests/api/check-params/config.ts | 5 +++++ server/tests/api/server/config.ts | 12 +++++++++++- server/tests/utils/videos/videos.ts | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) (limited to 'server/tests') diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index a2a404702..efc1e4e09 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts @@ -14,6 +14,11 @@ describe('Test config API validators', function () { let server: ServerInfo let userAccessToken: string const updateParams: CustomConfig = { + instance: { + name: 'PeerTube updated', + description: 'my super description', + terms: 'my super terms' + }, cache: { previews: { size: 2 diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index a1f8212bb..f83e21e82 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts @@ -49,6 +49,9 @@ describe('Test config', function () { const res = await getCustomConfig(server.url, server.accessToken) const data = res.body + expect(data.instance.name).to.equal('PeerTube') + expect(data.instance.description).to.be.empty + expect(data.instance.terms).to.be.empty expect(data.cache.previews.size).to.equal(1) expect(data.signup.enabled).to.be.true expect(data.signup.limit).to.equal(4) @@ -65,6 +68,11 @@ describe('Test config', function () { it('Should update the customized configuration', async function () { const newCustomConfig = { + instance: { + name: 'PeerTube updated', + description: 'my super description', + terms: 'my super terms' + }, cache: { previews: { size: 2 @@ -97,7 +105,9 @@ describe('Test config', function () { const res = await getCustomConfig(server.url, server.accessToken) const data = res.body - expect(data.cache.previews.size).to.equal(2) + expect(data.instance.name).to.equal('PeerTube updated') + expect(data.instance.description).to.equal('my super description') + expect(data.instance.terms).to.equal('my super terms') expect(data.signup.enabled).to.be.false expect(data.signup.limit).to.equal(5) expect(data.admin.email).to.equal('superadmin1@example.com') diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts index 860f04fd8..0b28edd48 100644 --- a/server/tests/utils/videos/videos.ts +++ b/server/tests/utils/videos/videos.ts @@ -373,7 +373,7 @@ async function completeVideoCheck ( expect(dateIsValid(video.createdAt)).to.be.true expect(dateIsValid(video.updatedAt)).to.be.true - const res = await getVideo(url, video.id) + const res = await getVideo(url, video.uuid) const videoDetails = res.body expect(videoDetails.files).to.have.lengthOf(attributes.files.length) -- cgit v1.2.3