auto-git:
[change] tests/domain/scene-document-validation.test.ts
This commit is contained in:
@@ -1266,6 +1266,9 @@ describe("validateSceneDocument", () => {
|
|||||||
const invalidFogBrush = createBoxBrush({
|
const invalidFogBrush = createBoxBrush({
|
||||||
id: "brush-invalid-volume-fog"
|
id: "brush-invalid-volume-fog"
|
||||||
});
|
});
|
||||||
|
const invalidLightBrush = createBoxBrush({
|
||||||
|
id: "brush-invalid-volume-light"
|
||||||
|
});
|
||||||
|
|
||||||
(invalidModeBrush as any).volume = {
|
(invalidModeBrush as any).volume = {
|
||||||
mode: "lava",
|
mode: "lava",
|
||||||
@@ -1292,13 +1295,23 @@ describe("validateSceneDocument", () => {
|
|||||||
padding: -0.5
|
padding: -0.5
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
(invalidLightBrush as any).volume = {
|
||||||
|
mode: "light",
|
||||||
|
light: {
|
||||||
|
colorHex: "light",
|
||||||
|
intensity: Number.NaN,
|
||||||
|
padding: -0.25,
|
||||||
|
falloff: "ease"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const validation = validateSceneDocument({
|
const validation = validateSceneDocument({
|
||||||
...createEmptySceneDocument(),
|
...createEmptySceneDocument(),
|
||||||
brushes: {
|
brushes: {
|
||||||
[invalidModeBrush.id]: invalidModeBrush,
|
[invalidModeBrush.id]: invalidModeBrush,
|
||||||
[invalidWaterBrush.id]: invalidWaterBrush,
|
[invalidWaterBrush.id]: invalidWaterBrush,
|
||||||
[invalidFogBrush.id]: invalidFogBrush
|
[invalidFogBrush.id]: invalidFogBrush,
|
||||||
|
[invalidLightBrush.id]: invalidLightBrush
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1335,6 +1348,22 @@ describe("validateSceneDocument", () => {
|
|||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
code: "invalid-box-fog-padding",
|
code: "invalid-box-fog-padding",
|
||||||
path: "brushes.brush-invalid-volume-fog.volume.fog.padding"
|
path: "brushes.brush-invalid-volume-fog.volume.fog.padding"
|
||||||
|
}),
|
||||||
|
expect.objectContaining({
|
||||||
|
code: "invalid-box-light-color",
|
||||||
|
path: "brushes.brush-invalid-volume-light.volume.light.colorHex"
|
||||||
|
}),
|
||||||
|
expect.objectContaining({
|
||||||
|
code: "invalid-box-light-intensity",
|
||||||
|
path: "brushes.brush-invalid-volume-light.volume.light.intensity"
|
||||||
|
}),
|
||||||
|
expect.objectContaining({
|
||||||
|
code: "invalid-box-light-padding",
|
||||||
|
path: "brushes.brush-invalid-volume-light.volume.light.padding"
|
||||||
|
}),
|
||||||
|
expect.objectContaining({
|
||||||
|
code: "invalid-box-light-falloff",
|
||||||
|
path: "brushes.brush-invalid-volume-light.volume.light.falloff"
|
||||||
})
|
})
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user