notAvailable.spec.tsx 670 B

1234567891011121314151617181920
  1. import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
  2. import NotAvailable from 'sentry/components/notAvailable';
  3. describe('NotAvailable', function () {
  4. it('renders', function () {
  5. render(<NotAvailable />);
  6. expect(screen.getByText('\u2014')).toBeInTheDocument();
  7. });
  8. it('renders with tooltip', async function () {
  9. render(<NotAvailable tooltip="Tooltip text" />);
  10. expect(screen.getByText('\u2014')).toBeInTheDocument();
  11. expect(screen.queryByText('Tooltip text')).not.toBeInTheDocument();
  12. userEvent.hover(screen.getByText('\u2014'));
  13. expect(await screen.findByText('Tooltip text')).toBeInTheDocument();
  14. });
  15. });