Configure circuit protection
This commit is contained in:
@@ -14,6 +14,10 @@ import {
|
||||
} from "../src/domain/services/protection-device-defaults.js";
|
||||
import { protectionDeviceConfigurationSchema } from "../src/shared/validation/protection-device.schemas.js";
|
||||
import "./circuit-protection-project-command.repository.test.js";
|
||||
import {
|
||||
getCircuitProtectionEditorInitialValue,
|
||||
toCircuitProtectionSnapshot,
|
||||
} from "../src/frontend/utils/circuit-protection-editing.js";
|
||||
|
||||
describe("protection device catalog", () => {
|
||||
it("contains exactly the agreed protection device types", () => {
|
||||
@@ -175,6 +179,32 @@ describe("protection device validation", () => {
|
||||
});
|
||||
|
||||
describe("protection device defaults", () => {
|
||||
it("maps editor values to complete circuit-owned snapshots", () => {
|
||||
const initial = getCircuitProtectionEditorInitialValue(
|
||||
"single_phase",
|
||||
undefined
|
||||
);
|
||||
assert.deepEqual(initial, {
|
||||
type: "FI_LS",
|
||||
ratedCurrentA: 16,
|
||||
tripCharacteristic: "B",
|
||||
rcdType: "A",
|
||||
ratedResidualCurrentMa: 30,
|
||||
});
|
||||
assert.deepEqual(
|
||||
toCircuitProtectionSnapshot("circuit-1", initial),
|
||||
{
|
||||
circuitId: "circuit-1",
|
||||
type: "FI_LS",
|
||||
ratedCurrentA: 16,
|
||||
fuseUtilizationCategory: null,
|
||||
tripCharacteristic: "B",
|
||||
rcdType: "A",
|
||||
ratedResidualCurrentMa: 30,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it("creates the agreed circuit defaults", () => {
|
||||
assert.deepEqual(createDefaultCircuitProtection("lighting"), {
|
||||
type: "LS",
|
||||
|
||||
Reference in New Issue
Block a user