Show leg distance in km on job list and on-board contracts (ISS-095, v0.48.0)
CI / build + unit + e2e (pull_request) Successful in 10m21s
CI / build + unit + e2e (pull_request) Successful in 10m21s
This commit is contained in:
+9
-1
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { formatCargo, formatCash, formatDeadlineRelative, formatDuration, formatFuel, formatSimClock } from './format';
|
||||
import { formatCargo, formatCash, formatDeadlineRelative, formatDuration, formatFuel, formatKm, formatSimClock } from './format';
|
||||
|
||||
describe('formatCash', () => {
|
||||
it('formats EUR with thousands separators and two decimals', () => {
|
||||
@@ -30,6 +30,14 @@ describe('formatCargo', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('formatKm', () => {
|
||||
it('rounds to integer km with no space before "km" (v0.48.0, ISS-095)', () => {
|
||||
expect(formatKm(554)).toBe('554km');
|
||||
expect(formatKm(214.6)).toBe('215km');
|
||||
expect(formatKm(0)).toBe('0km');
|
||||
});
|
||||
});
|
||||
|
||||
describe('formatSimClock', () => {
|
||||
it('formats epoch ms as a UTC wall-clock string with seconds (deterministic across timezones)', () => {
|
||||
expect(formatSimClock(Date.UTC(2026, 8, 17, 14, 5))).toBe('2026-09-17 14:05:00 UTC');
|
||||
|
||||
Reference in New Issue
Block a user