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