useBreakpoints.spec.tsx 579 B

12345678910111213141516171819202122232425
  1. import type {Theme} from '@emotion/react';
  2. import {checkBreakpoints} from 'sentry/utils/metrics/useBreakpoints';
  3. describe('checkBreakpoints', () => {
  4. it('returns true for active breakpoints', () => {
  5. const breakpoints: Theme['breakpoints'] = {
  6. xsmall: '0px',
  7. small: '0px',
  8. medium: '1px',
  9. large: '2px',
  10. xlarge: '3px',
  11. xxlarge: '4px',
  12. };
  13. expect(checkBreakpoints(breakpoints, 2)).toEqual({
  14. xsmall: true,
  15. small: true,
  16. medium: true,
  17. large: true,
  18. xlarge: false,
  19. xxlarge: false,
  20. });
  21. });
  22. });