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