formatter tests
Some checks failed
Some checks failed
This commit is contained in:
62
apps/website/lib/formatters/StatusFormatter.test.ts
Normal file
62
apps/website/lib/formatters/StatusFormatter.test.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { StatusFormatter } from './StatusFormatter';
|
||||
|
||||
describe('StatusFormatter', () => {
|
||||
describe('transactionStatus', () => {
|
||||
it('should format "paid" correctly', () => {
|
||||
expect(StatusFormatter.transactionStatus('paid')).toBe('Paid');
|
||||
});
|
||||
|
||||
it('should format "pending" correctly', () => {
|
||||
expect(StatusFormatter.transactionStatus('pending')).toBe('Pending');
|
||||
});
|
||||
|
||||
it('should format "overdue" correctly', () => {
|
||||
expect(StatusFormatter.transactionStatus('overdue')).toBe('Overdue');
|
||||
});
|
||||
|
||||
it('should format "failed" correctly', () => {
|
||||
expect(StatusFormatter.transactionStatus('failed')).toBe('Failed');
|
||||
});
|
||||
|
||||
it('should handle unknown status', () => {
|
||||
expect(StatusFormatter.transactionStatus('unknown')).toBe('unknown');
|
||||
});
|
||||
});
|
||||
|
||||
describe('raceStatus', () => {
|
||||
it('should format "scheduled" correctly', () => {
|
||||
expect(StatusFormatter.raceStatus('scheduled')).toBe('Scheduled');
|
||||
});
|
||||
|
||||
it('should format "running" correctly', () => {
|
||||
expect(StatusFormatter.raceStatus('running')).toBe('Live');
|
||||
});
|
||||
|
||||
it('should format "completed" correctly', () => {
|
||||
expect(StatusFormatter.raceStatus('completed')).toBe('Completed');
|
||||
});
|
||||
|
||||
it('should handle unknown status', () => {
|
||||
expect(StatusFormatter.raceStatus('unknown')).toBe('unknown');
|
||||
});
|
||||
});
|
||||
|
||||
describe('protestStatus', () => {
|
||||
it('should format "pending" correctly', () => {
|
||||
expect(StatusFormatter.protestStatus('pending')).toBe('Pending');
|
||||
});
|
||||
|
||||
it('should format "under_review" correctly', () => {
|
||||
expect(StatusFormatter.protestStatus('under_review')).toBe('Under Review');
|
||||
});
|
||||
|
||||
it('should format "resolved" correctly', () => {
|
||||
expect(StatusFormatter.protestStatus('resolved')).toBe('Resolved');
|
||||
});
|
||||
|
||||
it('should handle unknown status', () => {
|
||||
expect(StatusFormatter.protestStatus('unknown')).toBe('unknown');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user