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