[333] Blatt: Inhalts-Griff verschiebt den Plan im Rahmen (wie InDesign)

This commit is contained in:
Claude committed 2026-11-27 00:49:58 +00:00
1 parent 69507b10db
commit 58ce7ebabb
5 files changed
+107 -2

No files matched your search

+44
View File
@@ -343,3 +343,47 @@ test("[333] Blatt: Viewport vergrössern lässt den Inhalt liegen (wie InDesign)
expect(Math.abs(after.x - before.x), "Inhalt bleibt waagrecht").toBeLessThan(1.5);
expect(Math.abs(after.y - before.y), "Inhalt bleibt liegen (nicht neu zentriert)").toBeLessThan(1.5);
});
test("[333] Blatt: Inhalts-Griff verschiebt den Plan im Rahmen, der Rahmen bleibt", async ({ page }) => {
await startNewProject(page);
await openSample(page);
await openTab(page, "Ausschnitte");
await page.getByTitle("Ausschnitt speichern").first().click();
await page.getByPlaceholder("Ausschnitt speichern als:").fill("EG");
await page.keyboard.press("Enter");
await openNewLayout(page);
const paper = await paperBox(page);
await page.getByRole("button", { name: /Viewport aufziehen/ }).click();
const a = { x: paper.x + paper.width * 0.1, y: paper.y + paper.height * 0.1 };
const b = { x: paper.x + paper.width * 0.8, y: paper.y + paper.height * 0.5 };
await page.mouse.move(a.x, a.y);
await page.mouse.down();
await page.mouse.move(b.x, b.y, { steps: 6 });
await page.mouse.up();
const bind = page.locator(".layout-sheet-bind select");
if (await bind.isVisible().catch(() => false)) await bind.selectOption({ label: "EG" });
await expect(page.locator("[data-viewport-id] svg").first()).toBeAttached();
await page.keyboard.press("Escape");
await page.waitForTimeout(800);
const label = page.locator("[data-viewport-id] text", { hasText: "Wohnen" }).first();
const before = (await label.boundingBox())!;
const frame0 = (await page.locator("[data-viewport-id]").first().boundingBox())!;
await page.mouse.click((a.x + b.x) / 2 + 40, (a.y + b.y) / 2 + 30);
const grip = page.locator("[data-viewport-content-grip]");
await expect(grip).toBeVisible();
const g = (await grip.boundingBox())!;
const c = { x: g.x + g.width / 2, y: g.y + g.height / 2 };
await page.mouse.move(c.x, c.y);
await page.mouse.down();
await page.mouse.move(c.x + 30, c.y + 20, { steps: 5 });
await page.mouse.move(c.x + 60, c.y + 40, { steps: 5 });
await page.mouse.up();
await page.keyboard.press("Escape");
await page.mouse.click(paper.x + paper.width * 0.95, paper.y + paper.height * 0.95);
await page.waitForTimeout(1200);
const after = (await label.boundingBox())!;
expect(after.x - before.x, "Inhalt nach rechts").toBeGreaterThan(50);
expect(after.y - before.y, "Inhalt nach unten").toBeGreaterThan(30);
const frame1 = (await page.locator("[data-viewport-id]").first().boundingBox())!;
expect(Math.abs(frame1.x - frame0.x) + Math.abs(frame1.width - frame0.width), "Rahmen unverändert").toBeLessThan(2);
});