31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { DashboardLeaguePositionDisplay } from './DashboardLeaguePositionFormatter';
|
|
|
|
describe('DashboardLeaguePositionDisplay', () => {
|
|
describe('happy paths', () => {
|
|
it('should format position correctly', () => {
|
|
expect(DashboardLeaguePositionDisplay.format(1)).toBe('#1');
|
|
expect(DashboardLeaguePositionDisplay.format(5)).toBe('#5');
|
|
expect(DashboardLeaguePositionDisplay.format(100)).toBe('#100');
|
|
});
|
|
|
|
it('should handle null values', () => {
|
|
expect(DashboardLeaguePositionDisplay.format(null)).toBe('-');
|
|
});
|
|
|
|
it('should handle undefined values', () => {
|
|
expect(DashboardLeaguePositionDisplay.format(undefined)).toBe('-');
|
|
});
|
|
});
|
|
|
|
describe('edge cases', () => {
|
|
it('should handle position 0', () => {
|
|
expect(DashboardLeaguePositionDisplay.format(0)).toBe('#0');
|
|
});
|
|
|
|
it('should handle large positions', () => {
|
|
expect(DashboardLeaguePositionDisplay.format(999)).toBe('#999');
|
|
});
|
|
});
|
|
});
|