import { LitElement } from 'lit';
import { OverlayMixin } from '@lion/ui/overlays.js';
import { defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
import '@lion/ui/define/lion-listbox.js';
import '@lion/ui/define/lion-select-rich.js';
/**
* @typedef {import('../src/LionSelectRich.js').LionSelectRich} LionSelectRich
*/
const tagString = defineCE(
class extends OverlayMixin(LitElement) {
render() {
return html`
`;
}
},
);
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}
${tag}>
`);
properlyInstantiated = true;
} catch (e) {
throw new Error(/** @type {Error} */ (e).message);
}
expect(properlyInstantiated).to.be.true;
});
});