mock: バリアントの既定の印・バッジ・作成先を直す(T-30 単位3)
ポップオーバーの既定の印を「既定」の札にする。バッジには名前を書かず、 表示中のバリアント名はツールチップで示す(はみ出しをなくす。T-30の着手前の決定を反映)。 バリアントグループは選択の入れ物(クラスター・バリアント)の中に作る。 そのため domain に createVariantGroupInParent を足し、variant のIDを渡すと 例外になっていた parentNodes を直した。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NznQtmVPoQAnietqwr1auL
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
addComponentToParent,
|
||||
addKeyToParent,
|
||||
cloneNodesWithNewIds,
|
||||
createVariantGroupInParent,
|
||||
duplicateNode,
|
||||
insertNodes,
|
||||
} from "../src/domain/phyCommands";
|
||||
@@ -102,4 +103,22 @@ describe("PHY parent insertion and duplication", () => {
|
||||
}
|
||||
}
|
||||
});
|
||||
it("creates a variant group inside a cluster or a variant", () => {
|
||||
const variants: Parameters<typeof createVariantGroupInParent>[4] = [{ name: "A" }, { name: "B" }];
|
||||
let p = createVariantGroupInParent(file, "cl-parent", "G", { x: 0, y: 0, rotation: 0 }, variants, ids);
|
||||
const parent = p.root[0] as import("../src/domain/phy").ClusterNode;
|
||||
expect(p.root).toHaveLength(1);
|
||||
expect(parent.children.map((n) => n.type)).toEqual(["variantGroup"]);
|
||||
const group = parent.children[0] as import("../src/domain/phy").VariantGroupNode;
|
||||
p = createVariantGroupInParent(
|
||||
p,
|
||||
group.children[1]!.id,
|
||||
"Inner",
|
||||
{ x: 0, y: 0, rotation: 0 },
|
||||
variants,
|
||||
ids,
|
||||
);
|
||||
const updated = (p.root[0] as import("../src/domain/phy").ClusterNode).children[0] as typeof group;
|
||||
expect(updated.children[1]!.children.map((n) => n.type)).toEqual(["variantGroup"]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user