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