import { OverlayMixin } from '@lion/overlays';
import { LitElement } from '@lion/core';
import { defineCE, fixture, html, expect, unsafeStatic } from '@open-wc/testing';
import '@lion/listbox/lion-option';
import '@lion/listbox/lion-options';
import '../lion-select-rich.js';
/**
* @typedef {import('../src/LionSelectRich').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(e);
}
expect(properlyInstantiated).to.be.true;
});
});