All first todos completed

This commit is contained in:
2026-05-01 17:58:14 +02:00
parent 65819900b1
commit 18a4fdd893
29 changed files with 1263 additions and 160 deletions
+38
View File
@@ -0,0 +1,38 @@
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { createConsumerSchema } from "../src/shared/validation/consumer.schemas.js";
describe("consumer schema fixed option lists", () => {
it("accepts valid predefined domain values", () => {
const parsed = createConsumerSchema.safeParse({
projectId: "p1",
name: "Test",
quantity: 1,
installedPowerPerUnitKw: 1,
demandFactor: 1,
deviceType: "Beleuchtung",
phaseType: "3-phasig",
tradeOrCostGroup: "KG 440 Starkstromanlagen",
group: "Technik",
protectionType: "LS",
protectionCharacteristic: "C",
cableType: "NYM-J",
cableCrossSection: "2,5 mm²",
});
assert.equal(parsed.success, true);
});
it("rejects unknown domain values", () => {
const parsed = createConsumerSchema.safeParse({
projectId: "p1",
name: "Test",
quantity: 1,
installedPowerPerUnitKw: 1,
demandFactor: 1,
deviceType: "Irgendwas",
});
assert.equal(parsed.success, false);
});
});