From 01bdb6525a65664948adec7df056a66ce7627393 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Fri, 3 Apr 2026 00:24:27 +0200 Subject: [PATCH] Update entities foundation tests to use new preview functions --- tests/e2e/entities-foundation.e2e.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/e2e/entities-foundation.e2e.ts b/tests/e2e/entities-foundation.e2e.ts index f7a8a82d..7504940a 100644 --- a/tests/e2e/entities-foundation.e2e.ts +++ b/tests/e2e/entities-foundation.e2e.ts @@ -1,6 +1,6 @@ import { expect, test } from "@playwright/test"; -import { getEditorStoreSnapshot, setViewportPlacementPreview } from "./viewport-test-helpers"; +import { clickViewport, getEditorStoreSnapshot, setViewportCreationPreview } from "./viewport-test-helpers"; test("user can place and select typed entities from the entity foundation workflow", async ({ page }) => { const pageErrors: string[] = []; @@ -25,14 +25,14 @@ 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-sound-emitter").click(); - await setViewportPlacementPreview( + await setViewportCreationPreview( page, "topLeft", { kind: "entity", entityKind: "soundEmitter", audioAssetId: null }, { x: 4, y: 1, z: -6 } ); await expect(page.getByTestId("viewport-snap-preview-topLeft")).toBeVisible(); - await page.getByTestId("viewport-fallback-place-topLeft").dispatchEvent("click"); + await clickViewport(page, "topLeft"); const soundEmitterSnapshot = await getEditorStoreSnapshot(page); const selectedSoundEmitterId = soundEmitterSnapshot.selection.kind === "entities" ? soundEmitterSnapshot.selection.ids?.[0] ?? null : null; @@ -64,14 +64,14 @@ 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 setViewportPlacementPreview( + await setViewportCreationPreview( page, "topLeft", { kind: "entity", entityKind: "interactable", audioAssetId: null }, { x: -8, y: 1, z: 12 } ); await expect(page.getByTestId("viewport-snap-preview-topLeft")).toBeVisible(); - await page.getByTestId("viewport-fallback-place-topLeft").dispatchEvent("click"); + await clickViewport(page, "topLeft"); await expect(page.getByTestId("interactable-prompt")).toHaveValue("Use"); await page @@ -115,13 +115,13 @@ 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(); - await setViewportPlacementPreview( + await setViewportCreationPreview( page, "topLeft", { kind: "entity", entityKind: "pointLight", audioAssetId: null }, { x: 12, y: 3, z: -4 } ); - await page.getByTestId("viewport-fallback-place-topLeft").dispatchEvent("click"); + await clickViewport(page, "topLeft"); await expect(page.getByTestId("point-light-intensity")).toHaveValue("1.25"); expect(pageErrors).toEqual([]);