import { newSpecPage } from '@stencil/core/testing';
import { BsOverlay } from '../bs-overlay';
import { fireEvent } from '@testing-library/dom';
describe('bs-overlay', () => {
  it('renders', async () => {
    const page = await newSpecPage({
      components: [BsOverlay],
      html: `<bs-overlay />`,
    });
    expect(page.root).toEqualHtml(`<bs-overlay>
      <bs-transition enterattribute="data-shown" enterduration="75">
        <div class="bs-overlay"></div>
      </bs-transition>
    </bs-overlay>`);
  });
  // enter end
  it('should emit when transition enter ends', async () => {
    const page = await newSpecPage({
      components: [BsOverlay],
      html: `<bs-overlay />`,
    });
    const handler = jest.fn();
    page.root.addEventListener('enterend', handler);
    const transition = page.root.querySelector('bs-transition');
    fireEvent(transition, new CustomEvent('enterend'));
    expect(handler).toHaveBeenCalled();
  });
  // leave end
  it('should emit when transition leave ends', async () => {
    const page = await newSpecPage({
      components: [BsOverlay],
      html: `<bs-overlay />`,
    });
    const handler = jest.fn();
    page.root.addEventListener('leaveend', handler);
    const transition = page.root.querySelector('bs-transition');
    fireEvent(transition, new CustomEvent('leaveend'));
    expect(handler).toHaveBeenCalled();
  });
});
//# sourceMappingURL=bs-overlay.spec.js.map
