Platform backbone (plan 2026-10-13-plattform-rueckgrat), all tasks reviewed: - webhooks with delivery table, retries and stable delivery id - calendar handlers; a finished task removes its Outlook event - tasks, automations, inspections, varroa, treatments, feedings, harvests, colonies, wintering, stock and bottling record domain events in the same transaction; legacy post-commit calls removed - row locks through one helper (lockRowForUpdate, lockRowsForShare, lockRowsForUpdate) - job framework with JobRun, cli exit codes, cleanup, task templates, daily evaluation, hourly app-backup and the rekey job - system API and page "Verwaltung > System" with retry - @nestjs/schedule removed, guard tests against in-process schedulers Field capture T3 (plan 2026-10-13-t3-erfassung-am-stand), all tasks reviewed: - inspection photo offline without metadata - bulk capture for treatments, feedings and varroa (backend + frontend) - offline stand mode with service worker, offline pages and packs - offline session, cold start and logout on shared devices Docs: ARCHITECTURE.md assumptions and sections updated, TASKS.md. Gates: backend lint, typecheck, 1770 unit, 420 e2e, build, no schema drift; frontend lint, typecheck, 913 tests, build. Not rolled out. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
47 lines
1.9 KiB
TypeScript
47 lines
1.9 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
||
import {
|
||
entriesNotSent,
|
||
entriesRejected,
|
||
entriesSynced,
|
||
entriesWaiting,
|
||
foreignEntriesWaiting,
|
||
photosAttached,
|
||
photosNotTakenOver,
|
||
sessionExpiredWithEntries,
|
||
} from "./queue-texts";
|
||
|
||
describe("queue texts", () => {
|
||
it("uses the singular for exactly one entry", () => {
|
||
expect(entriesWaiting(1)).toBe("1 Eintrag wartet");
|
||
expect(entriesRejected(1)).toBe("1 Eintrag abgelehnt");
|
||
expect(foreignEntriesWaiting(1)).toBe("1 Eintrag eines anderen Kontos wartet");
|
||
expect(entriesSynced(1)).toBe("1 Eintrag synchronisiert");
|
||
expect(photosAttached(1)).toBe("+ 1 Foto");
|
||
expect(photosNotTakenOver(1)).toBe("1 Foto wurde nicht übernommen und verworfen");
|
||
});
|
||
|
||
it("uses the plural for two entries", () => {
|
||
expect(entriesWaiting(2)).toBe("2 Einträge warten");
|
||
expect(entriesRejected(2)).toBe("2 Einträge abgelehnt");
|
||
expect(foreignEntriesWaiting(2)).toBe("2 Einträge eines anderen Kontos warten");
|
||
expect(entriesSynced(2)).toBe("2 Einträge synchronisiert");
|
||
expect(photosAttached(2)).toBe("+ 2 Fotos");
|
||
expect(photosNotTakenOver(2)).toBe("2 Fotos wurden nicht übernommen und verworfen");
|
||
});
|
||
|
||
it("says how many entries are not sent yet when signing out", () => {
|
||
expect(entriesNotSent(1)).toBe("1 Eintrag ist noch nicht gesendet.");
|
||
expect(entriesNotSent(3)).toBe("3 Einträge sind noch nicht gesendet.");
|
||
});
|
||
|
||
it("tells an expired session apart from the entries that still wait", () => {
|
||
expect(sessionExpiredWithEntries(0)).toBe("Sitzung abgelaufen – bitte neu anmelden.");
|
||
expect(sessionExpiredWithEntries(1)).toBe(
|
||
"Sitzung abgelaufen – bitte neu anmelden. 1 Eintrag wartet und wird danach gesendet.",
|
||
);
|
||
expect(sessionExpiredWithEntries(4)).toBe(
|
||
"Sitzung abgelaufen – bitte neu anmelden. 4 Einträge warten und werden danach gesendet.",
|
||
);
|
||
});
|
||
});
|