27 lines
791 B
TypeScript
27 lines
791 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { UserRoleFormatter } from './UserRoleFormatter';
|
|
|
|
describe('UserRoleFormatter', () => {
|
|
describe('roleLabel', () => {
|
|
it('should format "owner" correctly', () => {
|
|
expect(UserRoleFormatter.roleLabel('owner')).toBe('Owner');
|
|
});
|
|
|
|
it('should format "admin" correctly', () => {
|
|
expect(UserRoleFormatter.roleLabel('admin')).toBe('Admin');
|
|
});
|
|
|
|
it('should format "user" correctly', () => {
|
|
expect(UserRoleFormatter.roleLabel('user')).toBe('User');
|
|
});
|
|
|
|
it('should handle unknown roles', () => {
|
|
expect(UserRoleFormatter.roleLabel('unknown')).toBe('unknown');
|
|
});
|
|
|
|
it('should handle empty string', () => {
|
|
expect(UserRoleFormatter.roleLabel('')).toBe('');
|
|
});
|
|
});
|
|
});
|