queryCount.spec.tsx 773 B

12345678910111213141516171819202122232425
  1. import {render} from 'sentry-test/reactTestingLibrary';
  2. import QueryCount from 'sentry/components/queryCount';
  3. describe('QueryCount', function () {
  4. it('displays count when no max', function () {
  5. render(<QueryCount count={5} />);
  6. });
  7. it('displays count when count < max', function () {
  8. render(<QueryCount count={5} max={500} />);
  9. });
  10. it('does not render if count is 0', function () {
  11. const {container} = render(<QueryCount count={0} />);
  12. expect(container).toBeEmptyDOMElement();
  13. });
  14. it('can render when count is 0 when `hideIfEmpty` is false', function () {
  15. render(<QueryCount count={0} hideIfEmpty={false} />);
  16. });
  17. it('displays max count if count >= max', function () {
  18. render(<QueryCount count={500} max={500} />);
  19. });
  20. });