firstEventIndicator.spec.tsx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import {initializeOrg} from 'sentry-test/initializeOrg';
  2. import {render, screen} from 'sentry-test/reactTestingLibrary';
  3. import {Indicator} from 'sentry/views/onboarding/components/firstEventIndicator';
  4. describe('FirstEventIndicator', function () {
  5. it('renders waiting status', function () {
  6. const {project, organization} = initializeOrg();
  7. render(
  8. <Indicator
  9. organization={organization}
  10. project={project}
  11. firstIssue={null}
  12. eventType="error"
  13. />
  14. );
  15. expect(
  16. screen.getByText('Waiting to receive first event to continue')
  17. ).toBeInTheDocument();
  18. });
  19. describe('received first event', function () {
  20. it('renders', function () {
  21. const {project, organization} = initializeOrg();
  22. render(
  23. <Indicator
  24. organization={organization}
  25. project={project}
  26. eventType="error"
  27. firstIssue={TestStubs.Group({id: 1})}
  28. />
  29. );
  30. expect(screen.getByText('Event was received!')).toBeInTheDocument();
  31. });
  32. it('renders without a known issue ID', function () {
  33. const {project, organization} = initializeOrg();
  34. render(
  35. <Indicator
  36. organization={organization}
  37. eventType="error"
  38. project={project}
  39. firstIssue
  40. />
  41. );
  42. // No button when there is no known issue ID
  43. expect(screen.getByText('Event was received!')).toBeInTheDocument();
  44. });
  45. });
  46. });