Files
inkwell/frontend/src/counted.test.ts
T
bvandeusenandClaude Opus 5.5 921c0a47bd Real plurals: the web's sync messages and Android's tag counts
Web: one counted(n, one, other) helper. The sync screen's three "(s)"
messages (attachments that didn't download, changes refused, files that
didn't upload) now say "1 file" / "2 files". The six hand-written ternaries
(SyncView x2, ImportNotes, GroupList, ShareDialog, LabelsModal) use it too.

Android: tags_count was two strings chosen in code, and is now <plurals>.
The delete confirmation read "It is on 1 notes … removed from all of them"
and now has a one form of its own.

Operator decision on #5371, 2026-10-08.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 16:57:09 -04:00

15 lines
422 B
TypeScript

import { describe, expect, it } from "vitest";
import { counted } from "./counted";
describe("counted", () => {
it("uses the singular for exactly one", () => {
expect(counted(1, "note", "notes")).toBe("1 note");
});
it("uses the plural for everything else, zero included", () => {
expect(counted(0, "note", "notes")).toBe("0 notes");
expect(counted(3, "person", "people")).toBe("3 people");
});
});