utils.spec.tsx 821 B

12345678910111213141516171819202122
  1. import {BreadcrumbType} from 'sentry/types/breadcrumbs';
  2. import type {Extraction} from 'sentry/utils/replays/hooks/useExtractedCrumbHtml';
  3. import {getDomMutationsTypes} from './utils';
  4. describe('getDomMutationsTypes', () => {
  5. const MUTATION_DEBUG = {crumb: {type: BreadcrumbType.DEBUG}} as Extraction;
  6. const MUTATION_UI = {crumb: {type: BreadcrumbType.UI}} as Extraction;
  7. it('should return a sorted list of BreadcrumbType', () => {
  8. const mutations = [MUTATION_DEBUG, MUTATION_UI];
  9. expect(getDomMutationsTypes(mutations)).toStrictEqual([
  10. BreadcrumbType.DEBUG,
  11. BreadcrumbType.UI,
  12. ]);
  13. });
  14. it('should deduplicate BreadcrumbType', () => {
  15. const mutations = [MUTATION_DEBUG, MUTATION_DEBUG];
  16. expect(getDomMutationsTypes(mutations)).toStrictEqual([BreadcrumbType.DEBUG]);
  17. });
  18. });