Create protected board defaults

This commit is contained in:
2026-07-30 19:30:53 +02:00
parent 012308984d
commit 9d4d4082fe
10 changed files with 504 additions and 156 deletions
+20 -6
View File
@@ -243,7 +243,13 @@ describe("project snapshot repository", () => {
);
assert.equal(state.circuits.length, 1);
assert.equal(state.circuitProtectionDevices.length, 1);
assert.equal(state.distributionBoardComponents.length, 1);
assert.equal(
state.distributionBoardComponents.length,
context.db
.select()
.from(distributionBoardComponents)
.all().length
);
assert.equal(
state.distributionBoardComponentProtectionDevices.length,
1
@@ -427,18 +433,26 @@ describe("portable project transfer", () => {
copied.state.circuits[0].id,
source.state.circuits[0].id
);
assert.notEqual(
copied.state.distributionBoardComponents[0].id,
source.state.distributionBoardComponents[0].id
);
assert.equal(copied.state.distributionBoardComponents.length, 3);
assert.equal(
copied.state.circuitProtectionDevices[0].circuitId,
copied.state.circuits[0].id
);
assert.equal(
copied.state.distributionBoardComponents.some(
(component) =>
component.id ===
copied.state
.distributionBoardComponentProtectionDevices[0]
.componentId
),
true
);
assert.notEqual(
copied.state.distributionBoardComponentProtectionDevices[0]
.componentId,
copied.state.distributionBoardComponents[0].id
source.state.distributionBoardComponentProtectionDevices[0]
.componentId
);
assert.equal(
copied.state.circuits[0].deviceRows[0].linkedProjectDeviceId,