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