@@ -1515,9 +1515,26 @@ test.describe("Workspace Manager V2 bootstrap", () => {
15151515 await expect(page.locator("#inputMappingV2DeviceList")).toContainText("InputService + MouseState + PointerDragState");
15161516 await expect(page.locator("#inputMappingV2DeviceList")).toContainText("InputService + GamepadState + GamepadInputAdapter");
15171517 await expect(page.locator("#inputMappingV2GestureList")).toContainText("Press");
1518- await expect(page.locator("#inputMappingV2GestureList")).toContainText("Drag Rectangle");
15191518 await expect(page.locator("#inputMappingV2GestureList")).toContainText("Wheel Up");
1519+ await expect(page.locator("#inputMappingV2GestureList")).toContainText("Wheel Down");
1520+ await expect(page.locator("#inputMappingV2GestureList")).toContainText("Wheel Left");
1521+ await expect(page.locator("#inputMappingV2GestureList")).toContainText("Wheel Right");
1522+ await expect(page.locator("#inputMappingV2GestureList")).toContainText("Drag Release");
1523+ await expect(page.locator("#inputMappingV2GestureList")).not.toContainText("Drag Rectangle");
1524+ await expect(page.locator("#inputMappingV2GestureList")).not.toContainText(/Mouse Move [XY]/);
15201525 await expect(page.locator("#inputMappingV2GestureList")).toContainText("Button");
1526+ const compactAccordionSpacing = await page.locator("#gestureSetupContent, #captureInputContent").evaluateAll((contents) => (
1527+ contents.map((content) => ({
1528+ columnGap: getComputedStyle(content).columnGap,
1529+ id: content.id,
1530+ paddingBottom: getComputedStyle(content).paddingBottom,
1531+ rowGap: getComputedStyle(content).rowGap
1532+ }))
1533+ ));
1534+ expect(compactAccordionSpacing).toEqual(expect.arrayContaining([
1535+ expect.objectContaining({ id: "gestureSetupContent", paddingBottom: "6px" }),
1536+ expect.objectContaining({ id: "captureInputContent", paddingBottom: "6px", rowGap: "6px" })
1537+ ]));
15211538 const gestureFlowLayout = await page.locator("#inputMappingV2GestureList").evaluate((container) => {
15221539 const wantedGroups = ["Keyboard", "Mouse", "Game Controller"];
15231540 const groupLayouts = wantedGroups.map((label) => {
@@ -1567,6 +1584,7 @@ test.describe("Workspace Manager V2 bootstrap", () => {
15671584 const rectFor = (selector) => {
15681585 const box = content.querySelector(selector).getBoundingClientRect();
15691586 return {
1587+ height: Math.round(box.height),
15701588 left: Math.round(box.left),
15711589 top: Math.round(box.top),
15721590 width: Math.round(box.width)
@@ -1581,7 +1599,9 @@ test.describe("Workspace Manager V2 bootstrap", () => {
15811599 };
15821600 });
15831601 expect(captureFlowLayout.keyboard.width).toBeGreaterThan(110);
1602+ expect(captureFlowLayout.keyboard.height).toBeLessThanOrEqual(36);
15841603 expect(captureFlowLayout.mouse.width).toBeGreaterThan(110);
1604+ expect(captureFlowLayout.mouse.height).toBeLessThanOrEqual(36);
15851605 expect(captureFlowLayout.mouse.left).toBeGreaterThan(captureFlowLayout.keyboard.left);
15861606 expect(Math.abs(captureFlowLayout.mouse.top - captureFlowLayout.keyboard.top)).toBeLessThanOrEqual(1);
15871607 expect(captureFlowLayout.note.top).toBeGreaterThan(captureFlowLayout.keyboard.top);
@@ -1703,8 +1723,38 @@ test.describe("Workspace Manager V2 bootstrap", () => {
17031723 }));
17041724 });
17051725 await expect(page.locator("#inputMappingV2CaptureMouseButton")).not.toHaveClass(/is-capturing/);
1726+ await page.evaluate(() => {
1727+ window.dispatchEvent(new PointerEvent("pointerdown", {
1728+ bubbles: true,
1729+ button: 0,
1730+ cancelable: true,
1731+ clientX: 12,
1732+ clientY: 16,
1733+ pointerId: 9,
1734+ pointerType: "mouse"
1735+ }));
1736+ window.dispatchEvent(new PointerEvent("pointermove", {
1737+ bubbles: true,
1738+ button: 0,
1739+ buttons: 1,
1740+ cancelable: true,
1741+ clientX: 52,
1742+ clientY: 66,
1743+ pointerId: 9,
1744+ pointerType: "mouse"
1745+ }));
1746+ window.dispatchEvent(new PointerEvent("pointerup", {
1747+ bubbles: true,
1748+ button: 0,
1749+ buttons: 0,
1750+ cancelable: true,
1751+ clientX: 72,
1752+ clientY: 96,
1753+ pointerId: 9,
1754+ pointerType: "mouse"
1755+ }));
1756+ });
17061757 await page.locator(".input-mapping-v2__gesture-button", { hasText: "Drag Release" }).click();
1707- await page.locator(".input-mapping-v2__gesture-button", { hasText: "Drag Rectangle" }).click();
17081758 await expect(page.locator(".input-mapping-v2__mapping-card")).toHaveCount(1);
17091759 const mappingTileBox = await page.locator(".input-mapping-v2__mapping-card").first().boundingBox();
17101760 expect(Math.round(mappingTileBox.width)).toBe(225);
@@ -1714,13 +1764,14 @@ test.describe("Workspace Manager V2 bootstrap", () => {
17141764 await expect(page.locator("#previewOutput")).toContainText("Keyboard KeyD");
17151765 await expect(page.locator("#previewOutput")).toContainText("Mouse Middle Button");
17161766 await expect(page.locator("#previewOutput")).toContainText("Mouse Drag Release");
1717- await expect(page.locator("#previewOutput")).toContainText("Mouse Drag Rectangle");
1767+ await expect(page.locator("#previewOutput")).not.toContainText("Mouse Drag Rectangle");
1768+ await expect(page.locator(".input-mapping-v2__input-token", { hasText: "Mouse Drag Release" })).toHaveAttribute("title", /Bounds: x 12, y 16, width 60, height 80/);
17181769 await expect(page.locator("#inspectorOutput")).toContainText('"action": "moveLeft"');
17191770 await expect(page.locator("#inspectorOutput")).toContainText('"binding": "KeyA"');
17201771 await expect(page.locator("#inspectorOutput")).toContainText('"binding": "KeyD"');
17211772 await expect(page.locator("#inspectorOutput")).toContainText('"binding": "MouseButton1"');
17221773 await expect(page.locator("#inspectorOutput")).toContainText('"binding": "MousePrimaryDragRelease"');
1723- await expect(page.locator("#inspectorOutput")).toContainText('"binding": "MousePrimaryDragRectangle"');
1774+ await expect(page.locator("#inspectorOutput")).not. toContainText('"binding": "MousePrimaryDragRectangle"');
17241775 await page.locator(".input-mapping-v2__input-token", { hasText: "Keyboard KeyA" }).click();
17251776 await expect(page.locator(".input-mapping-v2__input-token", { hasText: "Keyboard KeyA" })).toHaveCount(0);
17261777 await expect(page.locator(".input-mapping-v2__input-token", { hasText: "Keyboard KeyD" })).toHaveCount(1);
@@ -1798,12 +1849,14 @@ test.describe("Workspace Manager V2 bootstrap", () => {
17981849 const gamepadButtonLayout = await page.locator(".input-mapping-v2__gamepad-capture-button").evaluateAll((buttons) => buttons.map((button) => {
17991850 const box = button.getBoundingClientRect();
18001851 return {
1852+ height: Math.round(box.height),
18011853 left: Math.round(box.left),
18021854 top: Math.round(box.top),
18031855 width: Math.round(box.width)
18041856 };
18051857 }));
18061858 expect(gamepadButtonLayout.every((entry) => entry.width > 170)).toBe(true);
1859+ expect(gamepadButtonLayout.every((entry) => entry.height <= 60)).toBe(true);
18071860 expect(new Set(gamepadButtonLayout.map((entry) => entry.left)).size).toBe(2);
18081861 expect(Math.abs(gamepadButtonLayout[1].top - gamepadButtonLayout[0].top)).toBeLessThanOrEqual(1);
18091862 await page.locator(".input-mapping-v2__mapping-card[data-input-mapping-tile-action-id='moveLeft']").click({ position: { x: 12, y: 12 } });
0 commit comments