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