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