queryCount.spec.js 1018 B

12345678910111213141516171819202122232425262728293031
  1. import React from 'react';
  2. import {mountWithTheme} from 'sentry-test/enzyme';
  3. import QueryCount from 'app/components/queryCount';
  4. describe('QueryCount', function () {
  5. it('displays count when no max', function () {
  6. const wrapper = mountWithTheme(<QueryCount count={5} />);
  7. expect(wrapper).toSnapshot();
  8. });
  9. it('displays count when count < max', function () {
  10. const wrapper = mountWithTheme(<QueryCount count={5} max={500} />);
  11. expect(wrapper).toSnapshot();
  12. });
  13. it('does not render if count is 0', function () {
  14. const wrapper = mountWithTheme(<QueryCount count={0} />);
  15. expect(wrapper).toSnapshot();
  16. });
  17. it('can render when count is 0 when `hideIfEmpty` is false', function () {
  18. const wrapper = mountWithTheme(<QueryCount count={0} hideIfEmpty={false} />);
  19. expect(wrapper).toSnapshot();
  20. });
  21. it('displays max count if count >= max', function () {
  22. const wrapper = mountWithTheme(<QueryCount count={500} max={500} />);
  23. expect(wrapper).toSnapshot();
  24. });
  25. });