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`
`;
}
},
);
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;
});
});