Create clean release database baseline
This commit is contained in:
@@ -6,14 +6,12 @@ import {
|
||||
buildDeviceRowEditPatch,
|
||||
formatValue,
|
||||
getCircuitSectionLabel,
|
||||
getLegacyProjectColumnLayoutStorageKey,
|
||||
getProjectColumnLayoutStorageKey,
|
||||
isGridEditorControlTarget,
|
||||
getBlockSortValue,
|
||||
getCellKind,
|
||||
getCircuitValue,
|
||||
getDeviceValue,
|
||||
migrateLegacyColumnLayout,
|
||||
parseStoredColumnLayout,
|
||||
parseNumeric,
|
||||
} from "../src/frontend/utils/circuit-grid-model.js";
|
||||
@@ -41,9 +39,11 @@ const circuit: CircuitTreeCircuitDto = {
|
||||
equipmentIdentifier: "-1F1",
|
||||
displayName: "Lighting circuit",
|
||||
sortOrder: 10,
|
||||
protectionType: "MCB",
|
||||
protectionRatedCurrent: 16,
|
||||
protectionCharacteristic: "B",
|
||||
protectionDevice: {
|
||||
type: "LS",
|
||||
ratedCurrentA: 16,
|
||||
tripCharacteristic: "B",
|
||||
},
|
||||
cableType: "NYM-J",
|
||||
cableCrossSection: "1.5 mm²",
|
||||
cableLength: 20,
|
||||
@@ -83,10 +83,6 @@ describe("circuit grid model", () => {
|
||||
getProjectColumnLayoutStorageKey("project-1"),
|
||||
"circuitTreeEditor.columnLayout.v3.project-1"
|
||||
);
|
||||
assert.equal(
|
||||
getLegacyProjectColumnLayoutStorageKey("project-1"),
|
||||
"circuitTreeEditor.columnLayout.v2.project-1"
|
||||
);
|
||||
const layout = parseStoredColumnLayout(
|
||||
JSON.stringify({
|
||||
order: ["displayName", "equipmentIdentifier"],
|
||||
@@ -106,39 +102,6 @@ describe("circuit grid model", () => {
|
||||
assert.equal(parseStoredColumnLayout("{invalid"), null);
|
||||
});
|
||||
|
||||
it("adds the circuit protection column to legacy project layouts", () => {
|
||||
const legacyLayout = parseStoredColumnLayout(
|
||||
JSON.stringify({
|
||||
order: [
|
||||
"equipmentIdentifier",
|
||||
"displayName",
|
||||
"rowTotalPower",
|
||||
"remark",
|
||||
],
|
||||
visible: [
|
||||
"equipmentIdentifier",
|
||||
"displayName",
|
||||
"rowTotalPower",
|
||||
"remark",
|
||||
],
|
||||
})
|
||||
);
|
||||
assert.ok(legacyLayout);
|
||||
|
||||
const migrated = migrateLegacyColumnLayout(legacyLayout);
|
||||
assert.equal(
|
||||
migrated.order.indexOf("protectionSummary"),
|
||||
migrated.order.indexOf("rowTotalPower") + 1
|
||||
);
|
||||
assert.deepEqual(migrated.visible, [
|
||||
"equipmentIdentifier",
|
||||
"displayName",
|
||||
"rowTotalPower",
|
||||
"remark",
|
||||
"protectionSummary",
|
||||
]);
|
||||
});
|
||||
|
||||
it("shows stable circuit sections with German labels", () => {
|
||||
assert.equal(
|
||||
getCircuitSectionLabel({
|
||||
@@ -181,7 +144,7 @@ describe("circuit grid model", () => {
|
||||
it("projects circuit and device values without mixing ownership", () => {
|
||||
assert.equal(getDeviceValue(device, "roomSummary"), "1.01 Office");
|
||||
assert.equal(getDeviceValue(device, "rowTotalPower"), 0.08);
|
||||
assert.equal(getCircuitValue(circuit, "protectionSummary"), "MCB 16A B");
|
||||
assert.equal(getCircuitValue(circuit, "protectionSummary"), "LS · 16 A · B");
|
||||
assert.equal(
|
||||
getCircuitValue(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user