Confirm cross-section device moves
This commit is contained in:
@@ -3,6 +3,7 @@ import { describe, it } from "node:test";
|
||||
import {
|
||||
findDuplicateEquipmentIdentifierCircuitIds,
|
||||
hasEquipmentIdentifierConflict,
|
||||
requiresCrossSectionMoveConfirmation,
|
||||
resolveGridDeleteIntent,
|
||||
} from "../src/frontend/utils/circuit-grid-safety.js";
|
||||
|
||||
@@ -76,4 +77,11 @@ describe("circuit grid safety", () => {
|
||||
["a", "b"]
|
||||
);
|
||||
});
|
||||
|
||||
it("requires confirmation when any moved device crosses a section boundary", () => {
|
||||
assert.equal(requiresCrossSectionMoveConfirmation(["single"], "single"), false);
|
||||
assert.equal(requiresCrossSectionMoveConfirmation(["single", "single"], "single"), false);
|
||||
assert.equal(requiresCrossSectionMoveConfirmation(["single"], "three"), true);
|
||||
assert.equal(requiresCrossSectionMoveConfirmation(["single", "three"], "three"), true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user