import React from 'react';
import { render, screen } from '@testing-library/react';
import { PopupWithArrow } from './PopupWithArrow';
describe('Popup with arrow tests', function () {
    it('should render correct default state', function () {
        render(React.createElement(PopupWithArrow, { open: true, anchorEl: document.body },
            React.createElement("div", { "data-reltio-id": "popupContent" })));
        expect(document.querySelectorAll('.backdrop')).toHaveLength(1);
        expect(document.querySelector('.arrow')).toBeInTheDocument();
        expect(screen.getByRole('tooltip')).toBeInTheDocument();
        expect(screen.getByTestId('popupContent')).toBeInTheDocument();
        expect(screen.getByRole('tooltip').firstChild).not.toHaveAttribute('style');
    });
    it('should add transition if transition prop is true', function () {
        render(React.createElement(PopupWithArrow, { open: true, transition: true, anchorEl: document.body },
            React.createElement("div", { "data-reltio-id": "popupContent" })));
        expect(screen.getByRole('tooltip').firstChild).toHaveAttribute('style');
        expect(screen.getByTestId('popupContent')).toBeInTheDocument();
    });
});
