formatter tests
Some checks failed
Some checks failed
This commit is contained in:
26
apps/website/lib/formatters/UserRoleFormatter.test.ts
Normal file
26
apps/website/lib/formatters/UserRoleFormatter.test.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
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('');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user