firstEventIndicator.spec.tsx 1.5 KB

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