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