parseIssuePrioritySearch.spec.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import {parseIssuePrioritySearch} from 'sentry/views/issueList/utils/parseIssuePrioritySearch';
  2. describe('parseIssuePrioritySearch', function () {
  3. it('can parse array values', function () {
  4. const priorityValues = parseIssuePrioritySearch(
  5. 'is:unresolved issue.priority:[high,medium]'
  6. );
  7. expect(priorityValues).toEqual(new Set(['high', 'medium']));
  8. });
  9. it('can parse single values', function () {
  10. const priorityValues = parseIssuePrioritySearch(
  11. 'is:unresolved issue.priority:medium'
  12. );
  13. expect(priorityValues).toEqual(new Set(['medium']));
  14. });
  15. it('can parse negated array values', function () {
  16. const priorityValues = parseIssuePrioritySearch(
  17. 'is:unresolved !issue.priority:[low, medium]'
  18. );
  19. expect(priorityValues).toEqual(new Set(['high']));
  20. });
  21. it('can parse negated single values', function () {
  22. const priorityValues = parseIssuePrioritySearch(
  23. 'is:unresolved !issue.priority:medium'
  24. );
  25. expect(priorityValues).toEqual(new Set(['high', 'low']));
  26. });
  27. it('can parse query without priority', function () {
  28. const priorityValues = parseIssuePrioritySearch('is:unresolved');
  29. expect(priorityValues).toEqual(new Set(['high', 'medium', 'low']));
  30. });
  31. });