Align web editor with Blender 5.2 interface
This commit is contained in:
@@ -47,4 +47,41 @@ test.describe("M7-14 responsive layout", () => {
|
||||
expect(report.rootScrollWidth, JSON.stringify(report)).toBeLessThanOrEqual(report.viewportWidth);
|
||||
});
|
||||
}
|
||||
|
||||
test("desktop mirrors Blender 5.2 Layout workspace regions", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1440, height: 900 });
|
||||
await page.goto("/");
|
||||
await expect(page.getByTestId("engine-status")).toContainText("ready, open a .blend file", { timeout: 20_000 });
|
||||
|
||||
await expect(page.locator(".workspace-tab")).toHaveText([
|
||||
"Layout", "Modeling", "Sculpting", "UV Editing", "Texture Paint", "Shading",
|
||||
"Animation", "Rendering", "Compositing", "Geometry Nodes", "Scripting",
|
||||
]);
|
||||
const geometry = await page.evaluate(() => {
|
||||
const rect = (selector: string) => {
|
||||
const bounds = document.querySelector<HTMLElement>(selector)?.getBoundingClientRect();
|
||||
if (!bounds) throw new Error(`Missing ${selector}`);
|
||||
return { x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height, bottom: bounds.bottom };
|
||||
};
|
||||
const propertyTabs = document.querySelector<HTMLElement>(".property-tabs");
|
||||
return {
|
||||
viewport: rect(".viewport-area"),
|
||||
outliner: rect(".outliner-area"),
|
||||
properties: rect(".properties-area"),
|
||||
timeline: rect(".timeline-area"),
|
||||
status: rect(".status-bar"),
|
||||
propertyTabsDirection: propertyTabs ? getComputedStyle(propertyTabs).flexDirection : "missing",
|
||||
};
|
||||
});
|
||||
|
||||
expect(geometry.viewport.width / 1440).toBeGreaterThan(0.75);
|
||||
expect(geometry.outliner.x).toBeCloseTo(geometry.viewport.width + 1, 0);
|
||||
expect(geometry.outliner.height).toBeLessThan(geometry.properties.height);
|
||||
expect(geometry.properties.bottom).toBeCloseTo(geometry.status.y, 0);
|
||||
expect(geometry.timeline.x).toBe(0);
|
||||
expect(geometry.timeline.width).toBeCloseTo(geometry.viewport.width, 0);
|
||||
expect(geometry.timeline.height).toBeGreaterThanOrEqual(96);
|
||||
expect(geometry.timeline.height).toBeLessThanOrEqual(120);
|
||||
expect(geometry.propertyTabsDirection).toBe("column");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user