From 9c077f8967de69d99d2f9176b2cbfd6489d81eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20K=C3=A4ser?= Date: Mon, 25 Mar 2024 09:58:12 +0100 Subject: [PATCH] Correct styling. Add tests for special css variable properties in integration test --- .../okr/service/clientconfig/ClientConfigService.java | 1 + .../ch/puzzle/okr/service/ClientConfigServiceIT.java | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/backend/src/main/java/ch/puzzle/okr/service/clientconfig/ClientConfigService.java b/backend/src/main/java/ch/puzzle/okr/service/clientconfig/ClientConfigService.java index ff1bffc1d7..f06c7ca325 100644 --- a/backend/src/main/java/ch/puzzle/okr/service/clientconfig/ClientConfigService.java +++ b/backend/src/main/java/ch/puzzle/okr/service/clientconfig/ClientConfigService.java @@ -15,6 +15,7 @@ public class ClientConfigService { @Value("${spring.security.oauth2.resourceserver.opaquetoken.client-id}") private String clientId; + private final ClientCustomizationProperties clientCustomizationProperties; public ClientConfigService(ClientCustomizationProperties clientCustomizationProperties) { diff --git a/backend/src/test/java/ch/puzzle/okr/service/ClientConfigServiceIT.java b/backend/src/test/java/ch/puzzle/okr/service/ClientConfigServiceIT.java index a11a62c71e..a3f82fe631 100644 --- a/backend/src/test/java/ch/puzzle/okr/service/ClientConfigServiceIT.java +++ b/backend/src/test/java/ch/puzzle/okr/service/ClientConfigServiceIT.java @@ -5,10 +5,15 @@ import ch.puzzle.okr.test.SpringIntegrationTest; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; import static org.junit.jupiter.api.Assertions.assertEquals; @SpringIntegrationTest +@SpringBootTest(properties = { + "okr.clientcustomization.customstyles.okr-topbar-background-color=#affe00", + "okr.clientcustomization.customstyles.okr-other-css-style=rgba(50,60,70,0.5)", +}) class ClientConfigServiceIT { @Autowired @@ -20,6 +25,10 @@ void saveKeyResultShouldSaveNewKeyResult() { assertEquals("prod", clientConfig.activeProfile()); assertEquals("http://localhost:8544/realms/pitc", clientConfig.issuer()); + assertEquals("assets/favicon.png", clientConfig.favicon()); + assertEquals("assets/images/okr-logo.svg", clientConfig.logo()); + assertEquals("#affe00", clientConfig.customStyles().get("okr-topbar-background-color")); + assertEquals("rgba(50,60,70,0.5)", clientConfig.customStyles().get("okr-other-css-style")); } }