Skip to content

Commit

Permalink
test(accordion): test the visibility of the slotted content instead o…
Browse files Browse the repository at this point in the history
…f a shadow dom element (#161)
  • Loading branch information
daenub authored Apr 2, 2024
1 parent 98143c6 commit 5d996f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/accordion/test/accordion.test.js
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -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
})

Expand Down

0 comments on commit 5d996f2

Please sign in to comment.