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