auto-git:
[change] tests/domain/scene-document-validation.test.ts [change] tests/unit/entity-instances.test.ts [change] tests/unit/viewport-canvas.test.tsx
This commit is contained in:
@@ -609,6 +609,7 @@ describe("validateSceneDocument", () => {
|
||||
jump: "",
|
||||
sprint: "",
|
||||
crouch: "",
|
||||
interact: "",
|
||||
pauseTime: ""
|
||||
},
|
||||
gamepad: {
|
||||
@@ -616,6 +617,7 @@ describe("validateSceneDocument", () => {
|
||||
jump: "invalidButton",
|
||||
sprint: "invalidButton",
|
||||
crouch: "invalidButton",
|
||||
interact: "invalidButton",
|
||||
pauseTime: "invalidButton"
|
||||
}
|
||||
} as unknown as ReturnType<
|
||||
@@ -707,6 +709,9 @@ describe("validateSceneDocument", () => {
|
||||
expect.objectContaining({
|
||||
code: "invalid-player-start-crouch-keyboard-binding"
|
||||
}),
|
||||
expect.objectContaining({
|
||||
code: "invalid-player-start-interact-keyboard-binding"
|
||||
}),
|
||||
expect.objectContaining({
|
||||
code: "invalid-player-start-pause-keyboard-binding"
|
||||
}),
|
||||
@@ -719,6 +724,9 @@ describe("validateSceneDocument", () => {
|
||||
expect.objectContaining({
|
||||
code: "invalid-player-start-crouch-gamepad-binding"
|
||||
}),
|
||||
expect.objectContaining({
|
||||
code: "invalid-player-start-interact-gamepad-binding"
|
||||
}),
|
||||
expect.objectContaining({
|
||||
code: "invalid-player-start-pause-gamepad-binding"
|
||||
}),
|
||||
|
||||
@@ -76,7 +76,9 @@ describe("entity registry defaults", () => {
|
||||
moveRight: "KeyD",
|
||||
jump: "Space",
|
||||
sprint: "ShiftLeft",
|
||||
crouch: "ControlLeft"
|
||||
crouch: "ControlLeft",
|
||||
interact: "MouseLeft",
|
||||
pauseTime: "KeyP"
|
||||
},
|
||||
gamepad: {
|
||||
moveForward: "leftStickUp",
|
||||
@@ -86,6 +88,8 @@ describe("entity registry defaults", () => {
|
||||
jump: "buttonSouth",
|
||||
sprint: "leftStickPress",
|
||||
crouch: "buttonEast",
|
||||
interact: "buttonWest",
|
||||
pauseTime: "buttonMenu",
|
||||
cameraLook: "rightStick"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,16 +335,20 @@ describe("ViewportCanvas", () => {
|
||||
|
||||
it("pushes editor simulation scene state into the viewport host", async () => {
|
||||
const sceneDocument = createEmptySceneDocument();
|
||||
const editorSimulationScene = buildRuntimeSceneFromDocument(sceneDocument);
|
||||
const editorSimulationClock = createRuntimeClockState(sceneDocument.time);
|
||||
const editorSimulationController = new EditorSimulationController();
|
||||
editorSimulationController.updateInputs({
|
||||
document: sceneDocument,
|
||||
loadedModelAssets: {}
|
||||
});
|
||||
const editorSimulationFrame =
|
||||
editorSimulationController.getFrameSnapshot();
|
||||
|
||||
render(
|
||||
<ViewportCanvas
|
||||
panelId="topLeft"
|
||||
world={sceneDocument.world}
|
||||
sceneDocument={sceneDocument}
|
||||
editorSimulationScene={editorSimulationScene}
|
||||
editorSimulationClock={editorSimulationClock}
|
||||
editorSimulationController={editorSimulationController}
|
||||
projectAssets={sceneDocument.assets}
|
||||
loadedModelAssets={{}}
|
||||
loadedImageAssets={{}}
|
||||
@@ -379,8 +383,8 @@ describe("ViewportCanvas", () => {
|
||||
await waitFor(() => {
|
||||
expect(viewportHostInstances).toHaveLength(1);
|
||||
expect(viewportHostInstances[0].updateSimulation).toHaveBeenCalledWith(
|
||||
editorSimulationScene,
|
||||
editorSimulationClock
|
||||
editorSimulationFrame.runtimeScene,
|
||||
editorSimulationFrame.clock
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user