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