Skip to content

Commit

Permalink
added test for CharacterAnimator
Browse files Browse the repository at this point in the history
  • Loading branch information
DerKatsche committed Feb 21, 2024
1 parent 3103d0e commit f96eddd
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ describe("CharacterAnimator", () => {
`);
});

test("removeRotationObserver removes the onBeforeRenderObservable on the scene", () => {
const mockObserver = mock<Nullable<Observer<Scene>>>();
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<AnimationGroup>();
const toAnimation = mock<AnimationGroup>();
Expand Down

0 comments on commit f96eddd

Please sign in to comment.