From 80b1e469ca3626f527eb1f78788ef9a0be722202 Mon Sep 17 00:00:00 2001 From: clausbruun Date: Fri, 31 May 2024 14:25:22 +0200 Subject: [PATCH 1/2] Add unique ids for checkboxes --- src/components/multiselect/Multiselect.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/multiselect/Multiselect.tsx b/src/components/multiselect/Multiselect.tsx index 88f28946bf..711873448b 100644 --- a/src/components/multiselect/Multiselect.tsx +++ b/src/components/multiselect/Multiselect.tsx @@ -1,4 +1,4 @@ -import React, { FC, useRef, useState } from "react"; +import React, { FC, useId, useRef, useState } from "react"; import IconExpand from "@danskernesdigitalebibliotek/dpl-design-system/build/icons/collection/ExpandMore.svg"; import { useMultipleSelection } from "downshift"; import clsx from "clsx"; @@ -30,6 +30,7 @@ const Multiselect: FC = ({ defaultValue = [], updateExternalState }) => { + const id = useId(); const t = useText(); const ref = useRef(null); const [isDropdownOpen, setIsDropdownOpen] = useState(false); @@ -189,7 +190,7 @@ const Multiselect: FC = ({
selected.value === item.value From 421b18000f735f968ca6a145011554e3cec4e59c Mon Sep 17 00:00:00 2001 From: clausbruun Date: Mon, 3 Jun 2024 14:15:56 +0200 Subject: [PATCH 2/2] Expand advanced search test to third filter also --- src/apps/advanced-search/advanced-search.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/apps/advanced-search/advanced-search.test.ts b/src/apps/advanced-search/advanced-search.test.ts index d4012d9fec..9e6797bdec 100644 --- a/src/apps/advanced-search/advanced-search.test.ts +++ b/src/apps/advanced-search/advanced-search.test.ts @@ -47,6 +47,18 @@ describe("Search Result", () => { "contain", "'Harry' AND 'Prince' AND term.generalmaterialtype='bøger'" ); + cy.getBySel("advanced-search-accessibility") + .first() + .click() + .find("li") + .eq(2) + .should("contain", "Online") + .click(); + cy.getBySel("advanced-search-accessibility").first().click(); + cy.getBySel("preview-section", true).should( + "contain", + "'Harry' AND 'Prince' AND term.generalmaterialtype='bøger' AND term.accesstype='online'" + ); }); it("Should reset the form upon reset button click", () => {