import { describe, expect, it } from 'vitest';
import { dataKeysForRoute } from './App';

describe('access-rule route data isolation', () => {
  it('uses independent cache keys for workspace and admin access rules', () => {
    expect(dataKeysForRoute('workspace', 'overview', 'apiKeys', true)).toContain('apiKeyAccessRules');
    expect(dataKeysForRoute('workspace', 'overview', 'apiKeys', true)).not.toContain('adminAccessRules');

    expect(dataKeysForRoute('admin', 'userGroups', 'overview', true)).toContain('adminAccessRules');
    expect(dataKeysForRoute('admin', 'userGroups', 'overview', true)).not.toContain('apiKeyAccessRules');
  });
});
