This commit is contained in:
@@ -6,10 +6,17 @@ import {
|
||||
metricLobbyAxis,
|
||||
metricNumber,
|
||||
metricPercent,
|
||||
metricPeriodLabels
|
||||
metricPeriodLabels,
|
||||
metricPlayerPaths
|
||||
} from '../../src/lib/ui/metrics.js';
|
||||
|
||||
describe('metric presentation', () => {
|
||||
it('breaks player lines at missing history while retaining real zeroes and isolated points', () => {
|
||||
const paths = metricPlayerPaths([null, 2, 0, null, 1], 2);
|
||||
expect(paths.line).toBe('M30,0 L50,100 M90,50');
|
||||
expect(paths.area).toBe('M30,0 L50,100 L50,100 L30,100 Z M90,50 L90,100 L90,100 Z');
|
||||
expect(metricPlayerPaths([null, null], 1)).toEqual({ line: '', area: '' });
|
||||
});
|
||||
it('normalizes partial buckets by captured wall time and preserves unknown lobby counts', () => {
|
||||
expect(metricAverageLobbies(14 * 24, 24)).toBe(14);
|
||||
expect(metricAverageLobbies(14 * 0.5, 0.5)).toBe(14);
|
||||
|
||||
Reference in New Issue
Block a user