Skip to content

Commit 9638840

Browse files
Fix translation and add test (#1716)
2 parents a5890ac + 22716bc commit 9638840

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/client/cypress/e2e/filters/filter.cy.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,24 @@ describe("Search filter tests", () => {
245245
});
246246
});
247247

248+
it("filters boreholes by boreholestatus", () => {
249+
loginAsAdmin();
250+
cy.get('[data-cy="show-filter-button"]').click();
251+
cy.contains("Borehole").click();
252+
cy.contains("Show all fields").children(".checkbox").click();
253+
254+
let boreholeStatusDropdown = cy.contains("label", "Borehole status").next();
255+
256+
boreholeStatusDropdown.click();
257+
boreholeStatusDropdown.find("div[role='option']").then(options => {
258+
cy.wrap(options).contains("decayed").click({ force: true });
259+
});
260+
cy.wait("@edit_list");
261+
262+
cy.get('[data-cy="boreholes-number-preview"]').should("have.text", "169");
263+
cy.get('[data-cy="filter-chip-boreholestatus"]').contains("Borehole status");
264+
});
265+
248266
it("filters boreholes by color and uscs3", () => {
249267
loginAsAdmin();
250268
cy.get('[data-cy="show-filter-button"]').click();

src/client/src/pages/overview/sidePanelContent/filter/FilterChips.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const FilterChips = ({ activeFilters, setFilter }: FilterChipsProps) => {
3333
{activeFilters.map((filter, index) => {
3434
const customFilterLabels: { [key: string]: string } = {
3535
role: "status",
36-
status: "boreholeStatus",
36+
status: "boreholestatus",
3737
description_quality: "completeness",
3838
layer_gradation: "gradation",
3939
layer_depth_from_from: "fromdepth_from",
@@ -48,7 +48,7 @@ const FilterChips = ({ activeFilters, setFilter }: FilterChipsProps) => {
4848
<Tooltip key={index} title={filterLabel.length > 15 && filterLabel}>
4949
<Chip
5050
sx={{ marginRight: "10px", marginBottom: "10px" }}
51-
data-cy={`filter-chip-${filter.key}`}
51+
data-cy={`filter-chip-${customFilterLabels[filter.key] || filter.key}`}
5252
color="secondary"
5353
label={filterLabel.length < 15 ? filterLabel : filterLabel.substring(0, 15) + "..."}
5454
onDelete={() => onRemoveFilter(filter)}

0 commit comments

Comments
 (0)