view data tests
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { DashboardLeaguePositionDisplay } from './DashboardLeaguePositionDisplay';
|
||||
|
||||
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');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user