utils.spec.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import {getTabs} from './utils';
  2. describe('getTabs', () => {
  3. it('should enable/disable tabs for escalating-issues', () => {
  4. expect(
  5. getTabs(TestStubs.Organization({features: ['escalating-issues']})).map(
  6. tab => tab[1].name
  7. )
  8. ).toEqual([
  9. 'Unresolved',
  10. 'For Review',
  11. 'Regressed',
  12. 'Escalating',
  13. 'Archived',
  14. 'Custom',
  15. ]);
  16. expect(
  17. getTabs(TestStubs.Organization({features: []})).map(tab => tab[1].name)
  18. ).toEqual(['All Unresolved', 'For Review', 'Ignored', 'Custom']);
  19. });
  20. it('should enable/disable my_teams filter in For Review tab', () => {
  21. expect(
  22. getTabs(TestStubs.Organization({features: ['assign-to-me']})).map(tab => tab[0])
  23. ).toEqual([
  24. 'is:unresolved',
  25. 'is:unresolved is:for_review assigned_or_suggested:[me, my_teams, none]',
  26. 'is:ignored',
  27. '__custom__',
  28. ]);
  29. expect(getTabs(TestStubs.Organization({features: []})).map(tab => tab[0])).toEqual([
  30. 'is:unresolved',
  31. 'is:unresolved is:for_review assigned_or_suggested:[me, none]',
  32. 'is:ignored',
  33. '__custom__',
  34. ]);
  35. });
  36. });