Skip to content

Commit

Permalink
fixed 1 test of DoorView.test
Browse files Browse the repository at this point in the history
  • Loading branch information
AdLer-Lukas committed Feb 12, 2025
1 parent 6c8d8f5 commit a4c2d5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Components/Core/Presentation/Babylon/Door/DoorView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export default class DoorView extends Readyable {

// get meshes
this.viewModel.iconMeshes = loadingResults.meshes as Mesh[];
console.log(loadingResults);
// position and rotate icon
// Door is off centered, so we need to adjust the icon position based on rotation
let doorPosition = { ...this.viewModel.position };
Expand Down
14 changes: 10 additions & 4 deletions src/Components/CoreTest/Presentation/Babylon/Door/DoorView.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import {
AbstractMesh,
ActionManager,
AnimationGroup,
Color3,
ISceneLoaderAsyncResult,
Mesh,
NullEngine,
Quaternion,
Expand Down Expand Up @@ -52,7 +54,7 @@ describe("DoorView", () => {
});

test("constructor injects scenePresenter", () => {
scenePresenterMock.loadModel.mockResolvedValue([
scenePresenterMock.loadGLTFModel.mockResolvedValue([
new AbstractMesh("TestMesh", new Scene(new NullEngine())),
]);

Expand All @@ -74,9 +76,13 @@ describe("DoorView", () => {

//ANF-ID: [ELG0033]
test("constructor does not subscribe to viewModel.isOpen when isOpen is true, calls animation instead", async () => {
scenePresenterMock.loadModel.mockResolvedValue([
new AbstractMesh("TestMesh", new Scene(new NullEngine())),
]);
scenePresenterMock.loadGLTFModel.mockResolvedValue({
meshes: [new AbstractMesh("TestMesh", new Scene(new NullEngine()))],
animationGroups: [
new AnimationGroup("TestAnimation"),
new Scene(new NullEngine()),
],
} as ISceneLoaderAsyncResult);
const viewModel = new DoorViewModel();
viewModel.isOpen.Value = true;
viewModel.position = new Vector3(1, 2, 3);
Expand Down

0 comments on commit a4c2d5f

Please sign in to comment.