feat: voucher crud and list

This commit is contained in:
opencode committed 2026-10-18 10:30:55 +02:00
1 parent 73295653ee
commit 660d6cff51
7 files changed
+358

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
import { describe, it, expect } from "vitest";
import { validateVoucher, formatEuro } from "../lib/vouchers";
describe("validateVoucher", () => {
it("lehnt negativen Rest und Rest über Wert ab", () => {
const base = { name: "X", anbieter: "Y", wertCents: 5000, restCents: 6000, ablaufdatum: null };
expect(validateVoucher(base)).toContain("restCents");
expect(validateVoucher({ ...base, restCents: -1 })).toContain("restCents");
});
it("formatEuro zeigt 25,50 €", () => {
expect(formatEuro(2550)).toContain("25,50");
});
});