0.34.0: Übersicht mit Projektfarben, zweizeiligen Aufgaben und Geldfluss ohne Kontostand
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
@@ -240,8 +240,15 @@ describe.skipIf(!url)("Übernahme aus V70 über die API", () => {
|
||||
const u = (await app.inject(`/api/uebersicht?heute=${t.ueberschneidungen[0].ab}`)).json();
|
||||
expect(u.aufgaben.ueberfaellig.map((a: { text: string }) => a.text)).toContain("Statik anfragen");
|
||||
const arten = u.warnungen.map((w: { art: string }) => w.art);
|
||||
expect(arten).toEqual(expect.arrayContaining(["aufgabe", "kontostand"]));
|
||||
expect(u.warnungen.find((w: { art: string }) => w.art === "kontostand").text).toMatch(/nicht eingetragen/);
|
||||
// vorerst ohne Kontostand (Henning, 23.10.2026): keine Kontostand-Warnung, dafür Geldfluss je Woche
|
||||
expect(arten).toContain("aufgabe");
|
||||
expect(arten).not.toContain("kontostand");
|
||||
expect(u.fluss[0]).toEqual(expect.objectContaining({ einnahmen: expect.any(Number), projektkosten: expect.any(Number), laufend: expect.any(Number), ust: expect.any(Number) }));
|
||||
const e = (await app.inject("/api/einstellungen")).json();
|
||||
await app.inject({ method: "PUT", url: "/api/einstellungen", payload: { ...e, liquiditaetMitKontostand: true } });
|
||||
const mit = (await app.inject(`/api/uebersicht?heute=${t.ueberschneidungen[0].ab}`)).json();
|
||||
expect(mit.warnungen.find((w: { art: string }) => w.art === "kontostand").text).toMatch(/nicht eingetragen/);
|
||||
await app.inject({ method: "PUT", url: "/api/einstellungen", payload: e });
|
||||
expect(u.einsatz.tage).toHaveLength(8);
|
||||
expect(u.einsatz.zeilen.map((z: { anzeige: string }) => z.anzeige)).toContain("Henning Schaarschmidt");
|
||||
});
|
||||
|
||||
24
test/fluss.test.ts
Normal file
24
test/fluss.test.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { flussJeWoche } from "../src/domain/lage.js";
|
||||
import { projektFarbe, FARBEN } from "../src/domain/farbe.js";
|
||||
|
||||
describe("Geldfluss ohne Kontostand und Projektfarben", () => {
|
||||
it("teilt die Posten einer Woche nach Einnahmen, Projektkosten, laufenden Kosten und Umsatzsteuer", () => {
|
||||
const [w] = flussJeWoche([{ von: "2026-11-02", bis: "2026-11-08", einnahmen: 0, ausgaben: 0, saldo: 0, kontostand: 0, posten: [
|
||||
{ datum: "2026-11-02", gruppe: "Projekteinnahmen", bezeichnung: "Abschlag", betrag: 100000 },
|
||||
{ datum: "2026-11-03", gruppe: "Projektkosten", bezeichnung: "Material", betrag: -40000 },
|
||||
{ datum: "2026-11-01", gruppe: "Laufende Kosten", bezeichnung: "Miete", betrag: -5000 },
|
||||
{ datum: "2026-11-10", gruppe: "Umsatzsteuer", bezeichnung: "USt", betrag: 2000 },
|
||||
{ datum: "2026-11-10", gruppe: "Jahresplan", bezeichnung: "Plan", betrag: 9999 },
|
||||
] }] as never);
|
||||
expect(w).toEqual({ von: "2026-11-02", bis: "2026-11-08", einnahmen: 100000, projektkosten: 40000, laufend: 5000, ust: -2000 });
|
||||
});
|
||||
|
||||
it("Farbe nach Stelle unter den nicht abgeschlossenen Projekten, eigene Farbe geht vor", () => {
|
||||
const alle = [{ id: "a", status: "abgeschlossen" }, { id: "b", status: "auftrag" }, { id: "c", status: "angebot" }];
|
||||
expect(projektFarbe({ id: "b" }, alle)).toBe(FARBEN[0]);
|
||||
expect(projektFarbe({ id: "c" }, alle)).toBe(FARBEN[1]);
|
||||
expect(projektFarbe({ id: "a" }, alle)).toBe("#718096");
|
||||
expect(projektFarbe({ id: "c", farbe: "#123456" }, alle)).toBe("#123456");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user