releaseStats.spec.jsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import GroupReleaseStats from 'sentry/components/group/releaseStats';
  3. describe('GroupReleaseStats', function () {
  4. const organization = TestStubs.Organization();
  5. const project = TestStubs.Project();
  6. const createWrapper = props =>
  7. render(
  8. <GroupReleaseStats
  9. group={TestStubs.Group()}
  10. project={project}
  11. organization={organization}
  12. allEnvironments={TestStubs.Group()}
  13. environments={[]}
  14. {...props}
  15. />
  16. );
  17. it('renders all environments', function () {
  18. createWrapper();
  19. expect(screen.getByText('Last 24 Hours')).toBeInTheDocument();
  20. expect(screen.getByText('Last 30 Days')).toBeInTheDocument();
  21. expect(screen.getByText('Last seen')).toBeInTheDocument();
  22. expect(screen.getByText('First seen')).toBeInTheDocument();
  23. // Displays counts
  24. expect(screen.getByText('3')).toBeInTheDocument();
  25. expect(screen.getByText('123')).toBeInTheDocument();
  26. });
  27. it('renders specific environments', function () {
  28. createWrapper({environments: TestStubs.Environments()});
  29. expect(screen.getByText('Last 24 Hours')).toBeInTheDocument();
  30. expect(screen.getByText('Last 30 Days')).toBeInTheDocument();
  31. expect(screen.getByText('Last seen')).toBeInTheDocument();
  32. expect(screen.getByText('First seen')).toBeInTheDocument();
  33. // Displays counts
  34. expect(screen.getByText('3')).toBeInTheDocument();
  35. expect(screen.getByText('123')).toBeInTheDocument();
  36. });
  37. });