Update e2e tests to include additional snapshots and assertions

This commit is contained in:
2026-04-03 00:28:11 +02:00
parent d46f836d4b
commit b23848ff55
2 changed files with 27 additions and 1 deletions

View File

@@ -34,6 +34,14 @@ test("user can place and select typed entities from the entity foundation workfl
await expect(page.getByTestId("viewport-snap-preview-topLeft")).toBeVisible();
await clickViewport(page, "topLeft");
const soundEmitterSnapshot = await getEditorStoreSnapshot(page);
expect(soundEmitterSnapshot).toMatchObject({
toolMode: "select",
viewportTransientState: {
toolPreview: {
kind: "none"
}
}
});
const selectedSoundEmitterId =
soundEmitterSnapshot.selection.kind === "entities" ? soundEmitterSnapshot.selection.ids?.[0] ?? null : null;
@@ -72,6 +80,15 @@ test("user can place and select typed entities from the entity foundation workfl
);
await expect(page.getByTestId("viewport-snap-preview-topLeft")).toBeVisible();
await clickViewport(page, "topLeft");
const interactableSnapshot = await getEditorStoreSnapshot(page);
expect(interactableSnapshot).toMatchObject({
toolMode: "select",
viewportTransientState: {
toolPreview: {
kind: "none"
}
}
});
await expect(page.getByTestId("interactable-prompt")).toHaveValue("Use");
await page

View File

@@ -76,8 +76,17 @@ test("imports a model asset, places an instance, and survives reload", async ({
await setViewportCreationPreview(page, "topLeft", { kind: "model-instance", assetId: importedModelAsset.id }, { x: 92, y: 0, z: -76 });
await expect(page.getByTestId("viewport-snap-preview-topLeft")).toBeVisible();
await clickViewport(page, "topLeft");
const committedSnapshot = await getEditorStoreSnapshot(page);
expect(committedSnapshot).toMatchObject({
toolMode: "select",
viewportTransientState: {
toolPreview: {
kind: "none"
}
}
});
await expect(page.getByTestId("outliner-model-instance-list").getByRole("button")).toHaveCount(2);
const snapshot = await getEditorStoreSnapshot(page);
const snapshot = committedSnapshot;
const selectedModelInstanceId = snapshot.selection.kind === "modelInstances" ? snapshot.selection.ids?.[0] ?? null : null;
expect(selectedModelInstanceId).not.toBeNull();