From 86bee9e2cf5c97d1339d2cde59b3361e88973a7d Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Wed, 8 May 2024 13:08:15 +0200 Subject: [PATCH] feat: show info if no requests present --- .../etl/processor/web/HomeControllerTest.kt | 25 ++++++++----------- src/main/resources/static/style.css | 4 +++ src/main/resources/templates/index.html | 6 ++++- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt b/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt index c37236a..d227dcd 100644 --- a/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt +++ b/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt @@ -140,9 +140,8 @@ class HomeControllerTest { ) val page = webClient.getPage("http://localhost/") - assertThat( - page.querySelectorAll("tbody tr") - ).hasSize(2) + assertThat(page.querySelectorAll("tbody tr")).hasSize(2) + assertThat(page.querySelectorAll("div.notification.info")).isEmpty() } @Test @@ -167,9 +166,8 @@ class HomeControllerTest { ) val page = webClient.getPage("http://localhost/report/${requestId}") - assertThat( - page.querySelectorAll("tbody tr") - ).hasSize(1) + assertThat(page.querySelectorAll("tbody tr")).hasSize(1) + assertThat(page.querySelectorAll("div.notification.info")).isEmpty() } @Test @@ -201,9 +199,8 @@ class HomeControllerTest { ) val page = webClient.getPage("http://localhost/patient/PSEUDO1") - assertThat( - page.querySelectorAll("tbody tr") - ).hasSize(2) + assertThat(page.querySelectorAll("tbody tr")).hasSize(2) + assertThat(page.querySelectorAll("div.notification.info")).isEmpty() } } @@ -225,9 +222,8 @@ class HomeControllerTest { @Test fun testShouldShowHomePage() { val page = webClient.getPage("http://localhost/") - assertThat( - page.querySelectorAll("tbody tr") - ).isEmpty() + assertThat(page.querySelectorAll("tbody tr")).isEmpty() + assertThat(page.querySelectorAll("div.notification.info")).hasSize(1) } @Test @@ -252,9 +248,8 @@ class HomeControllerTest { whenever(requestService.findRequestByPatientId(anyString(), any())).thenReturn(Page.empty()) val page = webClient.getPage("http://localhost/patient/PSEUDO1") - assertThat( - page.querySelectorAll("tbody tr") - ).hasSize(0) + assertThat(page.querySelectorAll("tbody tr")).isEmpty() + assertThat(page.querySelectorAll("div.notification.info")).hasSize(1) } } diff --git a/src/main/resources/static/style.css b/src/main/resources/static/style.css index f6a916e..892b020 100644 --- a/src/main/resources/static/style.css +++ b/src/main/resources/static/style.css @@ -619,6 +619,10 @@ input.inline:focus-visible { text-align: center; } +.notification.info { + color: var(--bg-blue); +} + .notification.success { color: var(--bg-green); } diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index be3123b..520efb6 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -18,7 +18,11 @@ -
+
+
Noch keine Anfragen eingegangen
+
+ +