diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt | 24 | ||||
| -rw-r--r-- | src/main/resources/templates/index.html | 3 |
2 files changed, 26 insertions, 1 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 829f9a1..628112c 100644 --- a/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt +++ b/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt @@ -282,6 +282,30 @@ class HomeControllerTest { assertThat(page.querySelectorAll("tbody tr")).isEmpty() assertThat(page.querySelectorAll("div.notification.info")).hasSize(1) } + + @Test + @WithMockUser(username = "admin", roles = ["ADMIN"]) + fun testShouldShowNoConsentStatusBadge() { + whenever(requestService.findRequestByPatientId(anyValueClass(), any<Pageable>())).thenReturn( + PageImpl( + listOf( + Request( + 1L, + randomRequestId(), + PatientPseudonym("PSEUDO1"), + PatientId("PATIENT1"), + Fingerprint("ashdkasdh"), + RequestType.MTB_FILE, + RequestStatus.NO_CONSENT + ) + ) + ) + ) + + val page = webClient.getPage<HtmlPage>("http://localhost/patient/PSEUDO1") + assertThat(page.querySelectorAll("tbody tr")).hasSize(1) + assertThat(page.querySelectorAll("tbody tr > td > small").first().textContent).isEqualTo("NO_CONSENT") + } } } diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 7ca0b67..f48e3dc 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -54,6 +54,7 @@ <td th:if="${request.status.value.contains('error')}" class="bg-red"><small>[[ ${request.status} ]]</small></td> <td th:if="${request.status.value == 'unknown'}" class="bg-gray"><small>[[ ${request.status} ]]</small></td> <td th:if="${request.status.value == 'duplication'}" class="bg-gray"><small>[[ ${request.status} ]]</small></td> + <td th:if="${request.status.value == 'no-consent'}" class="bg-blue"><small>[[ ${request.status} ]]</small></td> <td th:style="${request.type.value == 'delete'} ? 'color: red;'"><small>[[ ${request.type} ]]</small></td> <td th:if="not ${request.report}">[[ ${request.uuid} ]]</td> <td th:if="${request.report}"> @@ -100,4 +101,4 @@ }); </script> </body> -</html>
\ No newline at end of file +</html> |
