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