import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary'; import IssueSyncListElement from 'sentry/components/issueSyncListElement'; describe('IssueSyncListElement', function () { it('renders', function () { const wrapper = render(); expect(wrapper.container).toSnapshot(); }); it('can open', function () { const onOpen = jest.fn(); render(); expect(onOpen).not.toHaveBeenCalled(); userEvent.click(screen.getByText('GitHub Issue')); expect(onOpen).toHaveBeenCalled(); }); it('can close', function () { const onClose = jest.fn(); const onOpen = jest.fn(); render( ); expect(onClose).not.toHaveBeenCalled(); userEvent.click(screen.getByRole('button', {name: 'Close'})); expect(onClose).toHaveBeenCalled(); }); });