auto-git:

[change] src/viewport-three/viewport-host.ts
 [change] tests/domain/build-runtime-scene.test.ts
 [change] tests/domain/custom-material.command.test.ts
 [change] tests/domain/delete-project-asset.test.ts
 [change] tests/domain/scene-document-validation.test.ts
 [change] tests/serialization/project-document-json.test.ts
 [change] tests/serialization/project-package.test.ts
 [change] tests/serialization/scene-document-json.test.ts
 [change] tests/unit/whitebox-material-inspector.integration.test.tsx
This commit is contained in:
2026-05-18 16:21:06 +02:00
parent 1fb96650c5
commit 2df1eb7eed
9 changed files with 226 additions and 166 deletions

View File

@@ -143,18 +143,19 @@ describe("whitebox material inspector", () => {
.mockImplementation(() => undefined);
const { container, store, brush } = await renderMaterialInspectorFixture();
expect(
container.querySelector(".material-browser button")
).toHaveAttribute("data-testid", "material-button-default-whitebox");
expect(screen.getByTestId("material-button-default-whitebox")).toHaveTextContent(
"Default Whitebox"
expect(container.querySelector(".material-browser button")).toHaveAttribute(
"data-testid",
"material-button-default-whitebox"
);
expect(
screen.getByTestId("material-button-default-whitebox")
).toHaveTextContent("Default Whitebox");
fireEvent.click(screen.getByTestId("create-custom-material"));
const customMaterial = Object.values(store.getState().document.materials).find(
(material) => material.kind === "custom"
);
const customMaterial = Object.values(
store.getState().document.materials
).find((material) => material.kind === "custom");
expect(customMaterial).toBeDefined();
expect(
@@ -186,19 +187,23 @@ describe("whitebox material inspector", () => {
throw new Error("Expected a custom material to be created.");
}
expect(store.getState().document.materials[editedMaterialId]).toMatchObject({
kind: "custom",
albedoColorHex: "#224466",
roughness: 0.37,
metallic: 0.58
});
expect(store.getState().document.materials[editedMaterialId]).toMatchObject(
{
kind: "custom",
albedoColorHex: "#224466",
roughness: 0.37,
metallic: 0.58
}
);
const exportedProject = store.exportDocumentJson();
const reloadedStore = createEditorStore();
reloadedStore.importDocumentJson(exportedProject);
expect(reloadedStore.getState().document.materials[editedMaterialId]).toMatchObject({
expect(
reloadedStore.getState().document.materials[editedMaterialId]
).toMatchObject({
kind: "custom",
albedoColorHex: "#224466",
roughness: 0.37,