Update e2e tests to include force option in hover and click actions

This commit is contained in:
2026-04-03 00:04:43 +02:00
parent 89344cc99f
commit a71e94eec9
2 changed files with 9 additions and 6 deletions

View File

@@ -26,9 +26,9 @@ test("user can place and select typed entities from the entity foundation workfl
await page.getByTestId("add-menu-entities").click();
await page.getByTestId("add-menu-sound-emitter").click();
const viewportCanvas = getViewportCanvas(page);
await viewportCanvas.hover({ position: { x: 124, y: 108 } });
await viewportCanvas.hover({ position: { x: 124, y: 108 }, force: true });
await expect(page.getByTestId("viewport-snap-preview-topLeft")).toBeVisible();
await viewportCanvas.click({ position: { x: 124, y: 108 } });
await viewportCanvas.click({ position: { x: 124, y: 108 }, force: true });
const soundEmitterSnapshot = await getEditorStoreSnapshot(page);
const selectedSoundEmitterId =
soundEmitterSnapshot.selection.kind === "entities" ? soundEmitterSnapshot.selection.ids?.[0] ?? null : null;
@@ -56,9 +56,9 @@ test("user can place and select typed entities from the entity foundation workfl
await page.getByTestId("outliner-add-button").click();
await page.getByTestId("add-menu-entities").click();
await page.getByTestId("add-menu-interactable").click();
await viewportCanvas.hover({ position: { x: 240, y: 156 } });
await viewportCanvas.hover({ position: { x: 240, y: 156 }, force: true });
await expect(page.getByTestId("viewport-snap-preview-topLeft")).toBeVisible();
await viewportCanvas.click({ position: { x: 240, y: 156 } });
await viewportCanvas.click({ position: { x: 240, y: 156 }, force: true });
await expect(page.getByTestId("interactable-prompt")).toHaveValue("Use");
await page
@@ -102,6 +102,9 @@ test("shift+a opens the add menu at the cursor", async ({ page }) => {
await expect(page.getByRole("menu", { name: "Add" })).toBeVisible();
await page.getByTestId("add-menu-lights").click();
await page.getByTestId("add-menu-point-light").click();
const pointLightViewportCanvas = getViewportCanvas(page);
await pointLightViewportCanvas.hover({ position: { x: 168, y: 128 }, force: true });
await pointLightViewportCanvas.click({ position: { x: 168, y: 128 }, force: true });
await expect(page.getByTestId("point-light-intensity")).toHaveValue("1.25");
expect(pageErrors).toEqual([]);

View File

@@ -33,9 +33,9 @@ test("imports a draco-compressed glb asset, places an instance, and survives rel
await page.getByRole("button", { name: "Place instance for tiny-triangle-draco.glb" }).click();
const viewportCanvas = getViewportCanvas(page);
await viewportCanvas.hover({ position: { x: 84, y: 88 } });
await viewportCanvas.hover({ position: { x: 84, y: 88 }, force: true });
await expect(page.getByTestId("viewport-snap-preview-topLeft")).toBeVisible();
await viewportCanvas.click({ position: { x: 84, y: 88 } });
await viewportCanvas.click({ position: { x: 84, y: 88 }, force: true });
await expect(page.getByTestId("outliner-model-instance-list").getByRole("button")).toHaveCount(2);
const snapshot = await getEditorStoreSnapshot(page);
const selectedModelInstanceId = snapshot.selection.kind === "modelInstances" ? snapshot.selection.ids?.[0] ?? null : null;