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