mock: キー・部品を足したあと、足したノードを選ぶ
ツリーの最後のノードを新しいノードとみなしていたため、クラスター内に足すと ツリーでそれより後ろにある別のキーを選んでいた。追加前後のIDの差で特定する。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XsamNKrWY3obJwR746oQRq
This commit is contained in:
@@ -603,3 +603,17 @@ test("「その他」の部品はpartGroupを設定せず、選択後は追加
|
||||
await expect(select).toHaveValue("");
|
||||
await expect(page.locator('[data-node-type="component"] .part-label').last()).toHaveText("part");
|
||||
});
|
||||
|
||||
test("クラスター内でキーを足すと、足したキーを選ぶ", async ({ page }) => {
|
||||
const cluster = await makeCluster(page);
|
||||
const clusterKeys = cluster.locator('[data-node-type="key"]');
|
||||
const before = await clusterKeys.evaluateAll((es) => es.map((e) => e.getAttribute("data-node-id")));
|
||||
await page.getByText("キー・部品 2件", { exact: true }).click();
|
||||
await page.locator(`[data-tree-id="${before[0]}"]`).first().click();
|
||||
await page.getByRole("button", { name: "キーを足す" }).click();
|
||||
await expect(clusterKeys).toHaveCount(3);
|
||||
const after = await clusterKeys.evaluateAll((es) => es.map((e) => e.getAttribute("data-node-id")));
|
||||
const added = after.find((id) => !before.includes(id));
|
||||
await expect(page.locator(`[data-sel-id="${added}"]`)).toHaveCount(1);
|
||||
await expect(page.locator("[data-sel-id]")).toHaveCount(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user