From 386dbd9c2b85029f4bd1d8671e675054314b5523 Mon Sep 17 00:00:00 2001 From: eliza Date: Mon, 2 Dec 2024 16:29:30 -0800 Subject: [PATCH 1/2] test(popover): ensure popover doesn't reopen when trigger is clicked and autoClose is true --- .../src/components/popover/popover.e2e.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/calcite-components/src/components/popover/popover.e2e.ts b/packages/calcite-components/src/components/popover/popover.e2e.ts index ec26b7628fc..ace343fcfed 100644 --- a/packages/calcite-components/src/components/popover/popover.e2e.ts +++ b/packages/calcite-components/src/components/popover/popover.e2e.ts @@ -683,6 +683,31 @@ describe("calcite-popover", () => { expect(await popover.getProperty("open")).toBe(false); }); + it("should not reopen when trigger is clicked and autoClose=true", async () => { + const page = await newE2EPage(); + + await page.setContent(html` + Content + + `); + + await page.waitForChanges(); + const popover = await page.find("calcite-popover"); + + expect(await popover.getProperty("open")).toBe(false); + + const referenceElement = await page.find("#ref"); + await referenceElement.click(); + await page.waitForChanges(); + + expect(await popover.getProperty("open")).toBe(true); + + await referenceElement.click(); + await page.waitForChanges(); + + expect(await popover.getProperty("open")).toBe(false); + }); + describe("setFocus", () => { const createPopoverHTML = (contentHTML?: string, attrs?: string) => `${contentHTML}`; From c6b87d997f350d5c7214b630eabefd89488b25fa Mon Sep 17 00:00:00 2001 From: eliza Date: Mon, 2 Dec 2024 17:21:31 -0800 Subject: [PATCH 2/2] add auto-close --- .../calcite-components/src/components/popover/popover.e2e.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/calcite-components/src/components/popover/popover.e2e.ts b/packages/calcite-components/src/components/popover/popover.e2e.ts index ace343fcfed..f0ea02bf118 100644 --- a/packages/calcite-components/src/components/popover/popover.e2e.ts +++ b/packages/calcite-components/src/components/popover/popover.e2e.ts @@ -687,7 +687,7 @@ describe("calcite-popover", () => { const page = await newE2EPage(); await page.setContent(html` - Content + Content `);