From 0bc53e20296de68288481e2375b297626087174b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 3 Dec 2021 17:04:47 +0100 Subject: Add ability to redirect users on external auth --- server/tests/api/check-params/config.ts | 12 ++++++++++++ server/tests/api/server/config.ts | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'server/tests/api') diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index d0cd7722b..a6e87730a 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts @@ -54,6 +54,18 @@ describe('Test config API validators', function () { whitelisted: true } }, + client: { + videos: { + miniature: { + preferAuthorDisplayName: false + } + }, + menu: { + login: { + redirectOnSingleExternalAuth: false + } + } + }, cache: { previews: { size: 2 diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index ea524723c..96ec17b0f 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts @@ -43,6 +43,9 @@ function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) { expect(data.services.twitter.username).to.equal('@Chocobozzz') expect(data.services.twitter.whitelisted).to.be.false + expect(data.client.videos.miniature.preferAuthorDisplayName).to.be.false + expect(data.client.menu.login.redirectOnSingleExternalAuth).to.be.false + expect(data.cache.previews.size).to.equal(1) expect(data.cache.captions.size).to.equal(1) expect(data.cache.torrents.size).to.equal(1) @@ -138,6 +141,9 @@ function checkUpdatedConfig (data: CustomConfig) { expect(data.services.twitter.username).to.equal('@Kuja') expect(data.services.twitter.whitelisted).to.be.true + expect(data.client.videos.miniature.preferAuthorDisplayName).to.be.true + expect(data.client.menu.login.redirectOnSingleExternalAuth).to.be.true + expect(data.cache.previews.size).to.equal(2) expect(data.cache.captions.size).to.equal(3) expect(data.cache.torrents.size).to.equal(4) @@ -246,6 +252,18 @@ const newCustomConfig: CustomConfig = { whitelisted: true } }, + client: { + videos: { + miniature: { + preferAuthorDisplayName: true + } + }, + menu: { + login: { + redirectOnSingleExternalAuth: true + } + } + }, cache: { previews: { size: 2 -- cgit v1.2.3