import { newSpecPage } from "@stencil/core/testing";
import { BpSdkQuotePayment } from "./bp-sdk-quote-payment";
const setupPage = async () => {
    return await newSpecPage({
        html: '<bp-sdk-quote-payment></bp-sdk-quote-payment>',
        components: [BpSdkQuotePayment],
    });
};
const setupInstance = (page) => {
    const instance = page.rootInstance;
    return instance;
};
describe('bp-sdk-quote-payment', () => {
    it('renders', async () => {
        const page = await setupPage();
        await page.waitForChanges();
        const element = page.root.querySelector('div');
        expect(element).toBeTruthy();
        expect(page.root.querySelector('bp-sdk-external-quote-payment')).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-payment')).toBeTruthy();
        whenDefinedMock.mockRestore();
    });
});
