From 5d996f2f33ca666a9598432d42b98f2684798042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20B=C3=BCschlen?= Date: Tue, 2 Apr 2024 15:34:15 +0200 Subject: [PATCH] test(accordion): test the visibility of the slotted content instead of a shadow dom element (#161) --- src/components/accordion/test/accordion.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/accordion/test/accordion.test.js b/src/components/accordion/test/accordion.test.js index 1f403896..33506720 100644 --- a/src/components/accordion/test/accordion.test.js +++ b/src/components/accordion/test/accordion.test.js @@ -1,5 +1,5 @@ import { html } from "lit" -import { fixture, expect } from "@open-wc/testing" +import { fixture, expect, elementUpdated, aTimeout } from "@open-wc/testing" import "../leu-accordion.js" @@ -88,11 +88,13 @@ describe("LeuAccordion", () => { ) const button = el.shadowRoot.querySelector("button") - const content = el.shadowRoot.querySelector(".content") + const content = el.querySelector("[slot=content]") expect(content).not.to.be.visible button.click() + await elementUpdated(el) + await aTimeout(100) expect(content).to.be.visible })