Files
gridpilot.gg/apps/website/lib/formatters/LeagueFormatter.test.ts
Marc Mintel 3db2209d2a
Some checks failed
CI / lint-typecheck (push) Failing after 4m52s
CI / tests (push) Has been skipped
CI / contract-tests (push) Has been skipped
CI / e2e-tests (push) Has been skipped
CI / comment-pr (push) Has been skipped
CI / commit-types (push) Has been skipped
formatter tests
2026-01-25 11:17:47 +01:00

27 lines
810 B
TypeScript

import { describe, it, expect } from 'vitest';
import { LeagueFormatter } from './LeagueFormatter';
describe('LeagueFormatter', () => {
describe('formatCount', () => {
it('should format 1 league correctly', () => {
expect(LeagueFormatter.formatCount(1)).toBe('1 league');
});
it('should format 2 leagues correctly', () => {
expect(LeagueFormatter.formatCount(2)).toBe('2 leagues');
});
it('should format 0 leagues correctly', () => {
expect(LeagueFormatter.formatCount(0)).toBe('0 leagues');
});
it('should format large numbers correctly', () => {
expect(LeagueFormatter.formatCount(100)).toBe('100 leagues');
});
it('should handle negative numbers', () => {
expect(LeagueFormatter.formatCount(-1)).toBe('-1 leagues');
});
});
});