import { describe, it, expect } from 'vitest';
import type { RoleDefinition } from '../base.role';

describe('RoleDefinition', () => {
  it('should define required role properties', () => {
    const role: RoleDefinition = {
      name: 'test',
      displayName: '测试角色',
      credentials: {
        username: 'testuser',
        password: 'Test@123'
      },
      permissions: ['test:read', 'test:write'],
      cannotAccess: ['/admin'],
      expectedBehaviors: {
        canCreate: ['test'],
        canRead: ['test'],
        canUpdate: ['test'],
        canDelete: []
      }
    };

    expect(role.name).toBe('test');
    expect(role.displayName).toBe('测试角色');
    expect(role.credentials.username).toBe('testuser');
    expect(role.credentials.password).toBe('Test@123');
    expect(role.permissions).toHaveLength(2);
    expect(role.cannotAccess).toHaveLength(1);
  });
});
