1
0
Fork 0

test: add invalid-date case for validateSchichtKorrektur

This commit is contained in:
Jonny 2026-07-13 16:48:51 +02:00
parent d91765bd69
commit 070b1287c1
1 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,11 @@ describe("validateSchichtKorrektur", () => {
expect(result).toEqual({ valid: false, error: "Bitte eine Geht-Uhrzeit angeben." }); expect(result).toEqual({ valid: false, error: "Bitte eine Geht-Uhrzeit angeben." });
}); });
it("lehnt eine nicht parsebare Geht-Uhrzeit ab", () => {
const result = validateSchichtKorrektur({ gehtUm: "garbage", kommtUm: "2026-07-13T06:00:00.000Z" });
expect(result).toEqual({ valid: false, error: "Ungueltige Geht-Uhrzeit." });
});
it("lehnt eine Geht-Uhrzeit vor der Kommt-Uhrzeit ab", () => { it("lehnt eine Geht-Uhrzeit vor der Kommt-Uhrzeit ab", () => {
const result = validateSchichtKorrektur({ const result = validateSchichtKorrektur({
gehtUm: "2026-07-13T05:00", gehtUm: "2026-07-13T05:00",