Add savings chat analysis feature

This commit is contained in:
Matthias
2026-06-15 18:26:25 +02:00
parent d65e7681ac
commit 4869402d45
26 changed files with 2789 additions and 163 deletions

View File

@@ -0,0 +1,36 @@
import { describe, expect, test } from "vitest";
import { toCategoryPieData } from "./categoryBreakdownData";
describe("toCategoryPieData", () => {
test("uses positive chart values while preserving signed expense amounts", () => {
expect(
toCategoryPieData([
{
name: "Lebensmittel",
amount: -123.45,
color: "#ef4444",
block: "variabel",
},
{
name: "Rueckerstattung",
amount: 12,
color: "#22c55e",
},
]),
).toEqual([
{
name: "Lebensmittel",
amount: -123.45,
chartAmount: 123.45,
color: "#ef4444",
block: "variabel",
},
{
name: "Rueckerstattung",
amount: 12,
chartAmount: 12,
color: "#22c55e",
},
]);
});
});