Update e2e tests to include additional snapshots and assertions
This commit is contained in:
@@ -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 expect(page.getByTestId("viewport-snap-preview-topLeft")).toBeVisible();
|
||||||
await clickViewport(page, "topLeft");
|
await clickViewport(page, "topLeft");
|
||||||
const soundEmitterSnapshot = await getEditorStoreSnapshot(page);
|
const soundEmitterSnapshot = await getEditorStoreSnapshot(page);
|
||||||
|
expect(soundEmitterSnapshot).toMatchObject({
|
||||||
|
toolMode: "select",
|
||||||
|
viewportTransientState: {
|
||||||
|
toolPreview: {
|
||||||
|
kind: "none"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
const selectedSoundEmitterId =
|
const selectedSoundEmitterId =
|
||||||
soundEmitterSnapshot.selection.kind === "entities" ? soundEmitterSnapshot.selection.ids?.[0] ?? null : null;
|
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 expect(page.getByTestId("viewport-snap-preview-topLeft")).toBeVisible();
|
||||||
await clickViewport(page, "topLeft");
|
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 expect(page.getByTestId("interactable-prompt")).toHaveValue("Use");
|
||||||
|
|
||||||
await page
|
await page
|
||||||
|
|||||||
@@ -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 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 expect(page.getByTestId("viewport-snap-preview-topLeft")).toBeVisible();
|
||||||
await clickViewport(page, "topLeft");
|
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);
|
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;
|
const selectedModelInstanceId = snapshot.selection.kind === "modelInstances" ? snapshot.selection.ids?.[0] ?? null : null;
|
||||||
|
|
||||||
expect(selectedModelInstanceId).not.toBeNull();
|
expect(selectedModelInstanceId).not.toBeNull();
|
||||||
|
|||||||
Reference in New Issue
Block a user