import { describe, it, expect } from 'vitest';
import { AdminRole } from '../admin.role';

describe('AdminRole', () => {
  it('should have admin credentials', () => {
    expect(AdminRole.name).toBe('admin');
    expect(AdminRole.displayName).toBe('超级管理员');
    expect(AdminRole.credentials.username).toBe('admin');
    expect(AdminRole.credentials.password).toBe('Test@123');
  });

  it('should have all permissions', () => {
    expect(AdminRole.permissions).toContain('user:*');
    expect(AdminRole.permissions).toContain('role:*');
    expect(AdminRole.permissions).toContain('menu:*');
    expect(AdminRole.cannotAccess).toHaveLength(0);
  });

  it('should be able to create all resources', () => {
    expect(AdminRole.expectedBehaviors.canCreate).toContain('user');
    expect(AdminRole.expectedBehaviors.canCreate).toContain('role');
    expect(AdminRole.expectedBehaviors.canCreate).toContain('menu');
  });
});
