Skip to content

Commit

Permalink
HTM-1389: add test data for search filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
mprins committed Dec 19, 2024
1 parent 4134015 commit 7b1dba2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,12 @@ public void createAppTestData() throws Exception {
.setAuthorizationRules(ruleAnonymousRead)
.setComponents(
List.of(
new Component()
.type("SIMPLE_SEARCH")
.config(

Check warning on line 983 in src/main/java/org/tailormap/api/configuration/dev/PopulateTestData.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/tailormap/api/configuration/dev/PopulateTestData.java#L982-L983

Added lines #L982 - L983 were not covered by tests
new ComponentConfig()
.enabled(true)
.putAdditionalProperty("municipalities", List.of("Utrecht"))),

Check warning on line 986 in src/main/java/org/tailormap/api/configuration/dev/PopulateTestData.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/tailormap/api/configuration/dev/PopulateTestData.java#L985-L986

Added lines #L985 - L986 were not covered by tests
new Component().type("EDIT").config(new ComponentConfig().enabled(true)),
new Component()
.type("COORDINATE_LINK_WINDOW")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 7b1dba2

Please sign in to comment.