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