Add configurable distribution supply types

This commit is contained in:
2026-07-29 09:31:20 +02:00
parent 194bc9c0b1
commit b1a11397b3
43 changed files with 5697 additions and 126 deletions
+35
View File
@@ -4,6 +4,7 @@ import { createElement } from "react";
import { renderToStaticMarkup } from "react-dom/server";
import { ProjectVersionHistory } from "../src/frontend/components/project-version-history.js";
import { ProjectDeviceModal } from "../src/frontend/components/project-device-modal.js";
import { ProjectSettingsModal } from "../src/frontend/components/project-settings-modal.js";
import type { ProjectRevisionSummaryDto } from "../src/frontend/types.js";
import {
createNamedProjectSnapshot,
@@ -99,6 +100,40 @@ describe("project version history presentation", () => {
});
});
describe("project settings presentation", () => {
it("shows all supply types and marks types already in use", () => {
const markup = renderToStaticMarkup(
createElement(ProjectSettingsModal, {
isSaving: false,
onClose: () => undefined,
onExport: async () => undefined,
onImport: async () => undefined,
onSave: async () => undefined,
project: {
id: "project-1",
name: "Projekt",
internalProjectNumber: null,
externalProjectNumber: null,
buildingOwner: null,
description: null,
singlePhaseVoltageV: 230,
threePhaseVoltageV: 400,
enabledDistributionBoardSupplyTypes: [
"AV",
"MSR",
"SiBe",
],
currentRevision: 0,
},
usedDistributionBoardSupplyTypes: ["SiBe"],
})
);
assert.match(markup, /MSR/);
assert.match(markup, /SiBe/);
assert.match(markup, /in Verwendung/);
});
});
describe("project device modal presentation", () => {
it("renders explicit German labels for every editable device field", () => {
const markup = renderToStaticMarkup(