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