Restore circuit drag placement
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { describe, it } from "node:test";
|
||||
import {
|
||||
getAdjacentInsertionSortOrder,
|
||||
getInsertionSortOrder,
|
||||
isGridInsertionRowType,
|
||||
resolveGridInsertionIntent,
|
||||
@@ -89,5 +90,26 @@ describe("circuit grid insertion", () => {
|
||||
assert.equal(getInsertionSortOrder(entries, "c"), 40);
|
||||
assert.equal(getInsertionSortOrder(entries), 40);
|
||||
assert.equal(getInsertionSortOrder([], "missing"), 10);
|
||||
assert.equal(
|
||||
getAdjacentInsertionSortOrder(entries, "a", "before"),
|
||||
0
|
||||
);
|
||||
assert.equal(
|
||||
getAdjacentInsertionSortOrder(entries, "b", "before"),
|
||||
15
|
||||
);
|
||||
assert.equal(
|
||||
getAdjacentInsertionSortOrder(entries, "b", "after"),
|
||||
25
|
||||
);
|
||||
assert.throws(
|
||||
() =>
|
||||
getAdjacentInsertionSortOrder(
|
||||
entries,
|
||||
"missing",
|
||||
"before"
|
||||
),
|
||||
/nicht gefunden/
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -101,6 +101,14 @@ describe("circuit grid model", () => {
|
||||
});
|
||||
|
||||
it("shows stable circuit sections with German labels", () => {
|
||||
assert.equal(
|
||||
getCircuitSectionLabel({
|
||||
key: "lighting",
|
||||
displayName: "Lighting",
|
||||
category: "lighting",
|
||||
}),
|
||||
"Lighting"
|
||||
);
|
||||
assert.equal(
|
||||
getCircuitSectionLabel({
|
||||
key: "lighting",
|
||||
|
||||
Reference in New Issue
Block a user