Co-authored-by: Isaac Sanchez <isanchez-hawkins@arize.com>
14 lines
400 B
TypeScript
14 lines
400 B
TypeScript
import { describe, expect, test } from 'bun:test';
|
|
|
|
import { clampPercent, formatPercent } from './utils';
|
|
|
|
describe('quota utils', () => {
|
|
test('treats non-finite percentages as missing', () => {
|
|
expect(clampPercent(Infinity)).toBeNull();
|
|
expect(clampPercent(-Infinity)).toBeNull();
|
|
|
|
expect(formatPercent(Infinity)).toBe('-');
|
|
expect(formatPercent(-Infinity)).toBe('-');
|
|
});
|
|
});
|