Job list shows cargo tonnage instead of count (ISS-066, v0.35.0)
CI / build + unit + e2e (pull_request) Failing after 10m9s
CI / build + unit + e2e (pull_request) Failing after 10m9s
This commit is contained in:
+10
-1
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { formatCash, formatDeadlineRelative, formatDuration, formatFuel, formatSimClock } from './format';
|
||||
import { formatCargo, formatCash, formatDeadlineRelative, formatDuration, formatFuel, formatSimClock } from './format';
|
||||
|
||||
describe('formatCash', () => {
|
||||
it('formats EUR with thousands separators and two decimals', () => {
|
||||
@@ -21,6 +21,15 @@ describe('formatFuel', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('formatCargo', () => {
|
||||
it('shows cargo type + tonnage with one decimal, like the loadout display', () => {
|
||||
expect(formatCargo('Mail', 10_000)).toBe('Mail 10.0t');
|
||||
// (250 / 1000).toFixed(1) === '0.3' — half rounds up at this value.
|
||||
expect(formatCargo('Electronics', 250)).toBe('Electronics 0.3t');
|
||||
expect(formatCargo('Mail', 40)).toBe('Mail 0.0t');
|
||||
});
|
||||
});
|
||||
|
||||
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