mock: スイッチ・スタビの十字をトグルで出し、スタビ候補を選べるようにする(T-30 単位8)
スタビ候補はキーの長辺の長さで引き、キーごとに複数選べる。選択は ProjectFile.ui.phy.stabilizers に持つ。 プロパティ欄に switchOffset の入力欄を置く。異形キーは候補なし。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017yoUu9Xd8dhwyQdCfKfaXG
This commit is contained in:
@@ -706,3 +706,37 @@ test("キャンバスのviewBoxはツールバーを除いたSVGの大きさに
|
||||
expect(Math.abs(w! - box.width)).toBeLessThan(1);
|
||||
expect(Math.abs(h! - box.height)).toBeLessThan(1);
|
||||
});
|
||||
|
||||
test("スイッチ・スタビの十字はトグルで出し、スタビ候補を複数選べる", async ({ page }) => {
|
||||
const key = page.locator('[data-node-type="key"]').first();
|
||||
const id = await key.getAttribute("data-node-id");
|
||||
await expect(page.locator(".mount-layer")).toHaveCount(0);
|
||||
await page.getByRole("button", { name: "スイッチ・スタビライザーの位置" }).click();
|
||||
const mark = page.locator(`[data-mount-id="${id}"]`);
|
||||
await expect(mark.locator(".switch")).toHaveCount(1);
|
||||
await expect(mark.locator(".stab")).toHaveCount(0);
|
||||
|
||||
await key.click();
|
||||
await expect(page.locator(".stabilizers")).toContainText("候補なし");
|
||||
await page.getByLabel("Width").fill("6.25");
|
||||
await page.getByLabel("Width").blur();
|
||||
for (const label of ["±50mm", "±40mm", "±42.5mm"]) await expect(page.getByLabel(label)).not.toBeChecked();
|
||||
await page.getByLabel("±50mm").check();
|
||||
await page.getByLabel("±40mm").check();
|
||||
await expect(mark.locator(".stab")).toHaveCount(4);
|
||||
|
||||
const switchX = async () => (await mark.locator(".switch").boundingBox())!.x;
|
||||
const before = await switchX();
|
||||
await page.getByLabel("switchOffset X").fill("0.625");
|
||||
await page.getByLabel("switchOffset X").blur();
|
||||
await expect.poll(switchX).toBeGreaterThan(before + 10);
|
||||
await expect(mark.locator(".stab")).toHaveCount(4);
|
||||
|
||||
await page.getByRole("button", { name: "Undo" }).click();
|
||||
await page.getByRole("button", { name: "Undo" }).click();
|
||||
await expect(mark.locator(".stab")).toHaveCount(2);
|
||||
await expect(page.getByLabel("±40mm")).not.toBeChecked();
|
||||
|
||||
await page.getByRole("button", { name: "スイッチ・スタビライザーの位置" }).click();
|
||||
await expect(page.locator(".mount-layer")).toHaveCount(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user