organizationRoles.spec.tsx 668 B

123456789101112131415161718
  1. import {OrganizationFixture} from 'sentry-fixture/organization';
  2. import {getOrgRoles} from 'getsentry/hooks/organizationRoles';
  3. describe('OrganizationRoles', function () {
  4. it('includes admin if org does not have team-roles', function () {
  5. const organization = OrganizationFixture({features: []});
  6. const result = getOrgRoles(organization);
  7. expect(result).toHaveLength(5);
  8. expect(result[2]?.id).toBe('admin');
  9. });
  10. it('does not include admin if org has team-roles', function () {
  11. const organization = OrganizationFixture({features: ['team-roles']});
  12. const result = getOrgRoles(organization);
  13. expect(result).toHaveLength(4);
  14. });
  15. });