import { newSpecPage } from "@stencil/core/testing";
import { BpSdkMessageOutlet } from "./bp-sdk-message-outlet";
describe('bp-sdk-message-outlet', () => {
    it('renders', async () => {
        const page = await newSpecPage({
            html: '<bp-sdk-message-outlet></bp-sdk-message-outlet>',
            components: [BpSdkMessageOutlet],
        });
        await page.waitForChanges();
        const element = page.root.querySelector('div');
        expect(element).toBeTruthy();
    });
    it('renders external component if defined', async () => {
        const whenDefinedMock = jest.spyOn(customElements, 'whenDefined').mockResolvedValueOnce({});
        const page = await newSpecPage({
            html: '<bp-sdk-message-outlet></bp-sdk-message-outlet>',
            components: [BpSdkMessageOutlet],
        });
        await page.waitForChanges();
        const element = page.root.querySelector('div');
        expect(element).toBeFalsy();
        expect(page.root.querySelector('bp-sdk-external-message-outlet')).toBeTruthy();
        whenDefinedMock.mockRestore();
    });
});
