import { newSpecPage } from "@stencil/core/testing";
import { BpSdkSendToExchangeButton } from "./bp-sdk-send-to-exchange-button";
describe('bp-sdk-send-to-exchange-button', () => {
    it('renders', async () => {
        const page = await newSpecPage({
            html: '<bp-sdk-send-to-exchange-button></bp-sdk-send-to-exchange-button>',
            components: [BpSdkSendToExchangeButton],
        });
        await page.waitForChanges();
        const element = page.root.querySelector('bp-sdk-button');
        expect(element).toBeTruthy();
        expect(page.root.querySelector('bp-sdk-external-send-to-exchange-button')).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-button></bp-sdk-send-to-exchange-button>',
            components: [BpSdkSendToExchangeButton],
        });
        await page.waitForChanges();
        expect(page.root.querySelector('bp-sdk-external-send-to-exchange-button')).toBeTruthy();
        whenDefinedMock.mockRestore();
    });
});
