chore: added test
This commit is contained in:
parent
3f1c83a180
commit
7cba2ef859
1 changed files with 31 additions and 0 deletions
|
|
@ -126,6 +126,37 @@ describe('<lion-accordion>', () => {
|
|||
);
|
||||
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`
|
||||
<lion-accordion>
|
||||
<h2 slot="invoker">
|
||||
<button>invoker 1</button>
|
||||
<button slot="invoker">Nested invoker</button>
|
||||
</h2>
|
||||
<h2 slot="invoker"><button>invoker 2</button></h2>
|
||||
<div slot="content">
|
||||
content 1
|
||||
<p slot="content">Nested content 1</p>
|
||||
</div>
|
||||
<div slot="content">
|
||||
content 2
|
||||
<p slot="content">Nested content 2</p>
|
||||
</div>
|
||||
</lion-accordion>
|
||||
`)
|
||||
);
|
||||
|
||||
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', () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue