fix: unify activity labels and Russian plurals
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { activityLevel, plural } from "../../src/lib/presentation.ts";
|
||||
|
||||
test("activity levels share one complete 0-100 scale", () => {
|
||||
assert.deepEqual(
|
||||
[0, 39, 40, 59, 60, 79, 80, 100].map(score => activityLevel(score).short),
|
||||
["Низкий", "Низкий", "Средний", "Средний", "Высокий", "Высокий", "Очень высокий", "Очень высокий"],
|
||||
);
|
||||
});
|
||||
|
||||
test("Russian plural forms cover common and exceptional endings", () => {
|
||||
const forms = ["точка", "точки", "точек"] as const;
|
||||
assert.deepEqual(
|
||||
[0, 1, 2, 5, 11, 21, 22, 25].map(number => plural(number, forms)),
|
||||
["точек", "точка", "точки", "точек", "точек", "точка", "точки", "точек"],
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user