[293] Wand-Oberkante als eine Auswahl (Geschosshöhe/Frei, Bis Decke, Bis Dach, tiefere von beiden): Objekt-Info und Befehl wand

This commit is contained in:
Claude committed 2026-11-19 10:49:42 +00:00
1 parent c7f7f66b33
commit c1b4dcf67a
14 files changed
+184 -71

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
// [293] Wand-Oberkante als EINE Auswahl (Objekt-Info): beide Felder in einer Op, ein Undo-Schritt.
// Prüfbild: doc/review-293/oberkante.png (Objekt-Info der Wand mit Auswahl „Oberkante“).
import { blurFocus, discardIfAsked, expect, fileMenu, test } from "./app";
test("Wand: Oberkante Auswahl setzt roofAttach/ceilingAttach zusammen, Undo in einem Schritt ([293])", async ({ page }) => {
await page.goto("/?dossierTest");
await page.getByRole("button", { name: /Neues Projekt/ }).first().click();
await expect(page.getByRole("group", { name: "Befehlszeile" })).toBeVisible();
await fileMenu(page, /^Neu aus Vorlage: Wettbewerb$/);
await discardIfAsked(page);
await expect(page.locator(".project-name")).toContainText("Wettbewerb");
const wallId = await page.evaluate(() => window.__dossierTest!.walls()[0].id);
const tops = () => page.evaluate((id) => window.__dossierTest!.wallTops()[id], wallId);
await page.evaluate((id) => window.__dossierTest!.select({ walls: [id] }), wallId);
const field = page.locator(".objinfo-field").filter({ hasText: "Oberkante" }).first();
await expect(field).toBeVisible();
const pick = async (name: string) => {
await field.getByRole("button").first().click();
await page.getByRole("option", { name, exact: true }).click();
};
expect(await tops()).toBeUndefined();
await pick("Bis Decke/Dach (tiefere)");
await expect.poll(tops).toEqual({ roofAttach: undefined, ceilingAttach: true });
await pick("Bis Decke");
await expect.poll(tops).toEqual({ roofAttach: false, ceilingAttach: true });
await pick("Bis Dach");
await expect.poll(tops).toEqual({ roofAttach: true, ceilingAttach: undefined });
// Ein Undo-Schritt macht die letzte Auswahl rückgängig (beide Felder zusammen).
await blurFocus(page);
await page.keyboard.press("ControlOrMeta+z");
await expect.poll(tops).toEqual({ roofAttach: false, ceilingAttach: true });
await page.setViewportSize({ width: 1700, height: 900 });
await page.waitForTimeout(800);
const box = (await field.boundingBox())!;
const x = Math.max(0, box.x - 40);
await page.screenshot({ path: "doc/review-293/oberkante.png", clip: { x, y: Math.max(0, box.y - 240), width: 420, height: 460 } });
});