Files
gridpilot.gg/apps/website/lib/display-objects/DashboardConsistencyDisplay.test.ts
Marc Mintel 1f4f837282
Some checks failed
Contract Testing / contract-tests (pull_request) Failing after 5m58s
Contract Testing / contract-snapshot (pull_request) Has been skipped
view data tests
2026-01-22 18:06:46 +01:00

24 lines
847 B
TypeScript

import { describe, it, expect } from 'vitest';
import { DashboardConsistencyDisplay } from './DashboardConsistencyDisplay';
describe('DashboardConsistencyDisplay', () => {
describe('happy paths', () => {
it('should format consistency correctly', () => {
expect(DashboardConsistencyDisplay.format(0)).toBe('0%');
expect(DashboardConsistencyDisplay.format(50)).toBe('50%');
expect(DashboardConsistencyDisplay.format(100)).toBe('100%');
});
});
describe('edge cases', () => {
it('should handle decimal consistency', () => {
expect(DashboardConsistencyDisplay.format(85.5)).toBe('85.5%');
expect(DashboardConsistencyDisplay.format(99.9)).toBe('99.9%');
});
it('should handle negative consistency', () => {
expect(DashboardConsistencyDisplay.format(-10)).toBe('-10%');
});
});
});