From 7cba2ef859a7830f8b4f77f6ed0e3d734716b889 Mon Sep 17 00:00:00 2001 From: Danny Moerkerke Date: Tue, 14 Mar 2023 13:40:40 +0100 Subject: [PATCH] chore: added test --- .../accordion/test/lion-accordion.test.js | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/packages/ui/components/accordion/test/lion-accordion.test.js b/packages/ui/components/accordion/test/lion-accordion.test.js index 9dff2f1a0..54b045b58 100644 --- a/packages/ui/components/accordion/test/lion-accordion.test.js +++ b/packages/ui/components/accordion/test/lion-accordion.test.js @@ -126,6 +126,37 @@ describe('', () => { ); stub.restore(); }); + + it('does not select any elements with slot="invoker" and slot="content" inside slotted elements', async () => { + const stub = sinon.stub(console, 'warn'); + const el = /** @type {LionAccordion} */ ( + await fixture(html` + +

+ + +

+

+
+ content 1 +

Nested content 1

+
+
+ content 2 +

Nested content 2

+
+
+ `) + ); + + const invokers = Array.from(getInvokers(el)); + const contents = Array.from(getContents(el)); + + expect(stub.called).to.be.false; + expect(invokers.length).to.equal(contents.length); + + stub.restore(); + }); }); describe('Accordion navigation', () => {