Implement expense tracking foundation for v1

This commit is contained in:
2026-03-23 12:32:36 -04:00
parent 5d7e25c015
commit 905af75cd8
39 changed files with 9923 additions and 9 deletions

View File

@@ -0,0 +1,27 @@
import { describe, expect, it } from "vitest";
import { expenseInputSchema } from "@/lib/validation";
describe("expenseInputSchema", () => {
it("accepts valid expense payloads", () => {
const parsed = expenseInputSchema.parse({
title: "Groceries",
amount: "64.32",
date: "2026-03-23",
category: "FOOD",
});
expect(parsed.amount).toBe(6432);
});
it("rejects invalid categories", () => {
const parsed = expenseInputSchema.safeParse({
title: "Groceries",
amount: "64.32",
date: "2026-03-23",
category: "OTHER",
});
expect(parsed.success).toBe(false);
});
});