import '../../../dist/zn.min.js'; import { expect, fixture, html } from '@open-wc/testing'; describe('', () => { it('should render a component', async () => { const el = await fixture(html` `); expect(el).to.exist; }); it('should lay out through a form that wraps the whole panel', async () => { const parent = await fixture(html`
Content
`); const form = parent.querySelector('form')!; expect(getComputedStyle(form).display).to.equal('contents'); expect(parent.querySelector('#panel')!.getBoundingClientRect().height).to.equal(400); }); it('should leave a form that shares the panel with siblings alone', async () => { const parent = await fixture(html`

Heading

Content
`); expect(getComputedStyle(parent.querySelector('form')!).display).to.equal('block'); }); it('should fill its parent container height when growing', async () => { const parent = await fixture(html`
Content
`); const el = parent.querySelector('zn-sp')!; const base = el.shadowRoot!.querySelector('[part="base"]')!; expect(el.getBoundingClientRect().height).to.equal(300); expect(base.getBoundingClientRect().height).to.equal(300); }); });