utils.spec.tsx 1.0 KB

12345678910111213141516171819202122232425262728293031
  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(['Unresolved', 'For Review', 'Regressed', 'Escalating', 'Archived']);
  9. expect(
  10. getTabs(TestStubs.Organization({features: []})).map(tab => tab[1].name)
  11. ).toEqual(['All Unresolved', 'For Review', 'Ignored']);
  12. });
  13. it('should enable/disable my_teams filter in For Review tab', () => {
  14. expect(
  15. getTabs(TestStubs.Organization({features: ['assign-to-me']})).map(tab => tab[0])
  16. ).toEqual([
  17. 'is:unresolved',
  18. 'is:unresolved is:for_review assigned_or_suggested:[me, my_teams, none]',
  19. 'is:ignored',
  20. ]);
  21. expect(getTabs(TestStubs.Organization({features: []})).map(tab => tab[0])).toEqual([
  22. 'is:unresolved',
  23. 'is:unresolved is:for_review assigned_or_suggested:[me, none]',
  24. 'is:ignored',
  25. ]);
  26. });
  27. });