feat: add unique waterbody fingerprints
This commit is contained in:
@@ -4,6 +4,7 @@ import test from "node:test";
|
||||
import { activityLevel, 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";
|
||||
|
||||
test("activity levels share one complete 0-100 scale", () => {
|
||||
assert.deepEqual(
|
||||
@@ -34,3 +35,14 @@ test("tackle glyphs only infer a type from explicit name terms", () => {
|
||||
);
|
||||
assert.equal(tackleVisualTone("Spiker #2"), tackleVisualTone("spiker #2"));
|
||||
});
|
||||
|
||||
test("waterbody fingerprints are stable, bounded and entity-specific", () => {
|
||||
const kuori = waterbodyVisual("kuori");
|
||||
assert.deepEqual(kuori, waterbodyVisual(" KUORI "));
|
||||
assert.notDeepEqual(kuori, waterbodyVisual("vyunok"));
|
||||
assert.ok(kuori.shore >= 0 && kuori.shore < 8);
|
||||
assert.ok(kuori.waves >= 1 && kuori.waves <= 3);
|
||||
assert.ok(kuori.markerX >= 32 && kuori.markerX <= 90);
|
||||
assert.ok(kuori.markerY >= 18 && kuori.markerY <= 40);
|
||||
assert.match(kuori.code, /^[0-9A-Z]{2}$/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user