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