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