import { LitElement } from '@lion/core'; import '@lion/listbox/define'; import { OverlayMixin } from '@lion/overlays'; import '@lion/select-rich/define'; import { defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing'; /** * @typedef {import('../src/LionSelectRich').LionSelectRich} LionSelectRich */ const tagString = defineCE( class extends OverlayMixin(LitElement) { render() { return html`
content of the overlay
`; } }, ); const tag = unsafeStatic(tagString); describe('Select Rich Integration tests', () => { it('works inside a dialog', async () => { let properlyInstantiated = false; try { const nestedEl = /** @type {LionSelectRich} */ ( await fixture(html` Item 1 Item 2 `) ); await nestedEl.registrationComplete; await fixture(html` <${tag} id="main">
open nested overlay: ${nestedEl}
`); properlyInstantiated = true; } catch (e) { throw new Error(/** @type {Error} */ (e).message); } expect(properlyInstantiated).to.be.true; }); });