fix: clarify blocked source status

This commit is contained in:
ik
2026-09-21 07:37:32 +07:00
parent 3b4557b549
commit 2ed28266df
5 changed files with 19 additions and 6 deletions
+7 -1
View File
@@ -1,7 +1,7 @@
import assert from "node:assert/strict";
import test from "node:test";
import { activityLevel, freshnessStatus, plural } from "../../src/lib/presentation.ts";
import { activityLevel, freshnessStatus, plural, sourceStatusLabel } 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";
@@ -30,6 +30,12 @@ test("freshness status is explicit and deterministic around the 48-hour boundary
assert.equal(freshnessStatus(null, now), "unknown");
});
test("source status makes a blocked provider explicit", () => {
assert.equal(sourceStatusLabel("temporarily_limited"), "Источник временно ограничен");
assert.equal(sourceStatusLabel("healthy"), "Актуален");
assert.equal(sourceStatusLabel("unexpected"), "Состояние не определено");
});
test("fish visual families follow body type instead of a name hash", () => {
assert.deepEqual(
["Щука", "Озёрная форель", "Карп", "Окунь", "Сом", "Угорь", "Палтус", "Треска", "Неизвестная рыба"].map(fishVisualFamily),