Kalender-Abos Baustellen und Aufgaben für Outlook classic, Caddy lässt /kalender ohne Anmeldung durch

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:
Claude
2026-10-19 19:04:14 +00:00
parent 8a4fbafa65
commit c2bbeff713
9 changed files with 245 additions and 6 deletions

22
test/ical.test.ts Normal file
View File

@@ -0,0 +1,22 @@
import { describe, expect, it } from "vitest";
import { kalender } from "../src/domain/ical.js";
import { arbeitsbloecke } from "../src/server/kalender.js";
import { STANDARDWOCHE as W } from "../src/domain/kalender.js";
describe("Kalender-Abo (T11)", () => {
it("ganztägige Termine, Ende am Folgetag, Sonderzeichen maskiert", () => {
const ics = kalender("Baustellen", [{ uid: "v1@x", von: "2026-10-26", bis: "2026-10-27", titel: "P-26-014 Abbund, Montage; HS" }], new Date("2026-10-19T08:00:00Z"));
expect(ics).toContain("DTSTART;VALUE=DATE:20261026\r\nDTEND;VALUE=DATE:20261028");
expect(ics).toContain("SUMMARY:P-26-014 Abbund\\, Montage\\; HS");
expect(ics).toContain("DTSTAMP:20261019T080000Z");
expect(ics.endsWith("END:VCALENDAR\r\n")).toBe(true);
});
it("lange Zeilen werden nach 75 Byte gefaltet", () => {
const ics = kalender("K", [{ uid: "u", von: "2026-10-26", bis: "2026-10-26", titel: "Ä".repeat(60) }]);
for (const z of ics.split("\r\n")) expect(new TextEncoder().encode(z).length).toBeLessThanOrEqual(75);
expect(ics.replace(/\r\n /g, "")).toContain("SUMMARY:" + "Ä".repeat(60));
});
it("Vorgang über Freitag und Wochenende wird in Arbeitsblöcke geteilt", () => {
expect(arbeitsbloecke("2026-10-21", "2026-10-27", W)).toEqual([["2026-10-21", "2026-10-22"], ["2026-10-26", "2026-10-27"]]);
});
});