From f96eddd00924748516cfeb06d0f47494201a135c Mon Sep 17 00:00:00 2001 From: Marius Kaczmarek Date: Wed, 21 Feb 2024 11:40:21 +0100 Subject: [PATCH] added test for CharacterAnimator --- .../CharacterAnimator/CharacterAnimator.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Components/CoreTest/Presentation/Babylon/CharacterAnimator/CharacterAnimator.test.ts b/src/Components/CoreTest/Presentation/Babylon/CharacterAnimator/CharacterAnimator.test.ts index 9677f6344..a0a0d6491 100644 --- a/src/Components/CoreTest/Presentation/Babylon/CharacterAnimator/CharacterAnimator.test.ts +++ b/src/Components/CoreTest/Presentation/Babylon/CharacterAnimator/CharacterAnimator.test.ts @@ -104,6 +104,20 @@ describe("CharacterAnimator", () => { `); }); + test("removeRotationObserver removes the onBeforeRenderObservable on the scene", () => { + const mockObserver = mock>>(); + systemUnderTest["rotationObserverRef"] = mockObserver; + + systemUnderTest["removeRotationObserver"](); + + expect( + scenePresenterMock.Scene.onBeforeRenderObservable.remove + ).toHaveBeenCalledTimes(1); + expect( + scenePresenterMock.Scene.onBeforeRenderObservable.remove + ).toHaveBeenCalledWith(mockObserver); + }); + test("onBeforeAnimationTransitionObserver removes the given observer from the onBeforeAniamtionObservable of the scene when the transition is done", () => { const fromAnimation = mock(); const toAnimation = mock();