fix: fixed failing accordion test

This commit is contained in:
Danny Moerkerke 2022-08-10 14:18:32 +02:00
parent 8a74e33625
commit 74201816eb
2 changed files with 11 additions and 7 deletions

View file

@ -157,9 +157,11 @@ export class LionAccordion extends LitElement {
* @private * @private
*/ */
__setupSlots() { __setupSlots() {
const invokerSlot = this.shadowRoot?.querySelector('slot[name=invoker]'); const invokerSlot = /** @type {HTMLSlotElement} */ (
this.shadowRoot?.querySelector('slot[name=invoker]')
);
const handleSlotChange = () => { const handleSlotChange = () => {
if (invokerSlot instanceof HTMLSlotElement && invokerSlot.assignedNodes().length > 0) { if (invokerSlot.assignedNodes().length > 0) {
this.__cleanStore(); this.__cleanStore();
this.__setupStore(); this.__setupStore();
this.__updateFocused(); this.__updateFocused();

View file

@ -191,6 +191,7 @@ describe('<lion-accordion>', () => {
const contents = getContents(el); const contents = getContents(el);
setTimeout(() => {
expect(contents[0]).to.be.visible; expect(contents[0]).to.be.visible;
expect(contents[1]).to.be.not.visible; expect(contents[1]).to.be.not.visible;
@ -198,6 +199,7 @@ describe('<lion-accordion>', () => {
expect(contents[0]).to.be.not.visible; expect(contents[0]).to.be.not.visible;
expect(contents[1]).to.be.visible; expect(contents[1]).to.be.visible;
}, 250);
}); });
it.skip('have a DOM structure that allows them to be animated ', async () => {}); it.skip('have a DOM structure that allows them to be animated ', async () => {});