From 22716bcd0de769212bedf43ce62428e9e7300b9f Mon Sep 17 00:00:00 2001 From: MiraGeowerkstatt Date: Mon, 2 Dec 2024 09:17:23 +0100 Subject: [PATCH] Fix translation and add test --- src/client/cypress/e2e/filters/filter.cy.js | 18 ++++++++++++++++++ .../sidePanelContent/filter/FilterChips.tsx | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/client/cypress/e2e/filters/filter.cy.js b/src/client/cypress/e2e/filters/filter.cy.js index dc55751b0..11b6f2a3d 100644 --- a/src/client/cypress/e2e/filters/filter.cy.js +++ b/src/client/cypress/e2e/filters/filter.cy.js @@ -245,6 +245,24 @@ describe("Search filter tests", () => { }); }); + it("filters boreholes by boreholestatus", () => { + loginAsAdmin(); + cy.get('[data-cy="show-filter-button"]').click(); + cy.contains("Borehole").click(); + cy.contains("Show all fields").children(".checkbox").click(); + + let boreholeStatusDropdown = cy.contains("label", "Borehole status").next(); + + boreholeStatusDropdown.click(); + boreholeStatusDropdown.find("div[role='option']").then(options => { + cy.wrap(options).contains("decayed").click({ force: true }); + }); + cy.wait("@edit_list"); + + cy.get('[data-cy="boreholes-number-preview"]').should("have.text", "169"); + cy.get('[data-cy="filter-chip-boreholestatus"]').contains("Borehole status"); + }); + it("filters boreholes by color and uscs3", () => { loginAsAdmin(); cy.get('[data-cy="show-filter-button"]').click(); diff --git a/src/client/src/pages/overview/sidePanelContent/filter/FilterChips.tsx b/src/client/src/pages/overview/sidePanelContent/filter/FilterChips.tsx index 51d2b5edf..80ea40a52 100644 --- a/src/client/src/pages/overview/sidePanelContent/filter/FilterChips.tsx +++ b/src/client/src/pages/overview/sidePanelContent/filter/FilterChips.tsx @@ -33,7 +33,7 @@ const FilterChips = ({ activeFilters, setFilter }: FilterChipsProps) => { {activeFilters.map((filter, index) => { const customFilterLabels: { [key: string]: string } = { role: "status", - status: "boreholeStatus", + status: "boreholestatus", description_quality: "completeness", layer_gradation: "gradation", layer_depth_from_from: "fromdepth_from", @@ -48,7 +48,7 @@ const FilterChips = ({ activeFilters, setFilter }: FilterChipsProps) => { 15 && filterLabel}> onRemoveFilter(filter)}