From 7b1dba229cfe455e1c908544a914c81e5dd3d011 Mon Sep 17 00:00:00 2001 From: Mark Prins <1165786+mprins@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:36:30 +0100 Subject: [PATCH] HTM-1389: add test data for search filtering --- .../tailormap/api/configuration/dev/PopulateTestData.java | 6 ++++++ .../api/controller/AppControllerIntegrationTest.java | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/tailormap/api/configuration/dev/PopulateTestData.java b/src/main/java/org/tailormap/api/configuration/dev/PopulateTestData.java index ecaa30c03..c26ad869d 100644 --- a/src/main/java/org/tailormap/api/configuration/dev/PopulateTestData.java +++ b/src/main/java/org/tailormap/api/configuration/dev/PopulateTestData.java @@ -978,6 +978,12 @@ public void createAppTestData() throws Exception { .setAuthorizationRules(ruleAnonymousRead) .setComponents( List.of( + new Component() + .type("SIMPLE_SEARCH") + .config( + new ComponentConfig() + .enabled(true) + .putAdditionalProperty("municipalities", List.of("Utrecht"))), new Component().type("EDIT").config(new ComponentConfig().enabled(true)), new Component() .type("COORDINATE_LINK_WINDOW") diff --git a/src/test/java/org/tailormap/api/controller/AppControllerIntegrationTest.java b/src/test/java/org/tailormap/api/controller/AppControllerIntegrationTest.java index 6fb346a32..35e5af7df 100644 --- a/src/test/java/org/tailormap/api/controller/AppControllerIntegrationTest.java +++ b/src/test/java/org/tailormap/api/controller/AppControllerIntegrationTest.java @@ -45,9 +45,12 @@ void returns_default_when_no_arguments() throws Exception { .andExpect(jsonPath("$.name").value("default")) .andExpect(jsonPath("$.title").value("Tailormap demo")) .andExpect(jsonPath("$.components").isArray()) - .andExpect(jsonPath("$.components.length()").value(2)) - .andExpect(jsonPath("$.components[0].type").value("EDIT")) + .andExpect(jsonPath("$.components.length()").value(3)) + .andExpect(jsonPath("$.components[0].type").value("SIMPLE_SEARCH")) .andExpect(jsonPath("$.components[0].config.enabled").value(true)) + .andExpect(jsonPath("$.components[0].config.municipalities").value("Utrecht")) + .andExpect(jsonPath("$.components[1].type").value("EDIT")) + .andExpect(jsonPath("$.components[1].config.enabled").value(true)) .andExpect(jsonPath("$.styling.primaryColor").isEmpty()) .andExpect( jsonPath(