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