alertBadge.spec.tsx 688 B

12345678910111213141516171819
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import AlertBadge from 'sentry/components/alertBadge';
  3. import {IncidentStatus} from 'sentry/views/alerts/types';
  4. describe('AlertBadge', () => {
  5. it('displays status', () => {
  6. render(<AlertBadge status={IncidentStatus.CLOSED} />);
  7. expect(screen.getByText('Resolved')).toBeInTheDocument();
  8. });
  9. it('hides status text', () => {
  10. render(<AlertBadge hideText status={IncidentStatus.CLOSED} />);
  11. expect(screen.queryByText('Resolved')).not.toBeInTheDocument();
  12. });
  13. it('can be an issue badge', () => {
  14. render(<AlertBadge isIssue />);
  15. expect(screen.getByText('Issue')).toBeInTheDocument();
  16. });
  17. });