feat: label stale evidence data
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { activityLevel, plural } from "../../src/lib/presentation.ts";
|
||||
import { activityLevel, freshnessStatus, plural } from "../../src/lib/presentation.ts";
|
||||
import { fishVisualFamily } from "../../src/lib/fish-visuals.ts";
|
||||
import { tackleVisualKind, tackleVisualTone } from "../../src/lib/tackle-visuals.ts";
|
||||
import { waterbodyVisual } from "../../src/lib/waterbody-visuals.ts";
|
||||
@@ -23,6 +23,13 @@ test("Russian plural forms cover common and exceptional endings", () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("freshness status is explicit and deterministic around the 48-hour boundary", () => {
|
||||
const now = Date.parse("2026-09-20T12:00:00Z");
|
||||
assert.equal(freshnessStatus("2026-09-20T11:59:00Z", now), "fresh");
|
||||
assert.equal(freshnessStatus("2026-09-18T11:59:00Z", now), "stale");
|
||||
assert.equal(freshnessStatus(null, now), "unknown");
|
||||
});
|
||||
|
||||
test("fish visual families follow body type instead of a name hash", () => {
|
||||
assert.deepEqual(
|
||||
["Щука", "Озёрная форель", "Карп", "Окунь", "Сом", "Угорь", "Палтус", "Треска", "Неизвестная рыба"].map(fishVisualFamily),
|
||||
|
||||
Reference in New Issue
Block a user