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