import { isAuditListUnrestricted } from './audit-list-scope';

describe('audit-list-scope', () => {
  describe('isAuditListUnrestricted', () => {
    it('allows SUPER_ADMIN to see all logs', () => {
      expect(isAuditListUnrestricted('SUPER_ADMIN')).toBe(true);
    });

    it('scopes MATCH_ADMIN, FINANCE_ADMIN, and SUPPORT', () => {
      expect(isAuditListUnrestricted('MATCH_ADMIN')).toBe(false);
      expect(isAuditListUnrestricted('FINANCE_ADMIN')).toBe(false);
      expect(isAuditListUnrestricted('SUPPORT')).toBe(false);
    });

    it('scopes unknown or missing role', () => {
      expect(isAuditListUnrestricted(undefined)).toBe(false);
      expect(isAuditListUnrestricted(null)).toBe(false);
    });
  });
});
