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