Skip to content

Commit

Permalink
Merge 945ca53 into 187f9d5
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Mar 11, 2019
2 parents 187f9d5 + 945ca53 commit 676d56b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/AnimationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ export class AnimationManager {
this.animateTo(movedPos, duration);
} else {
this.em.triggerChange(movedPos);
this.em.triggerFinish(false);
this.itm.setInterrupt(false);
}

Expand Down
20 changes: 20 additions & 0 deletions test/unit/AnimationManager.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,26 @@ describe("AnimationManager", function () {
afterEach(() => {
this.component.off();
});
it("should check 'setTo' method(duration: 0)", () => {
// Given
const changeHandler = sinon.spy();
const finishHandler = sinon.spy();
this.component.on({
"change": changeHandler,
"finish": finishHandler,
});

// When
this.inst.setTo({
x: 100,
y: 200
}, 0);

// Then
expect(changeHandler.calledOnce).to.be.true;
expect(finishHandler.calledOnce).to.be.true;
expect(this.inst.axm.get()).to.be.eql({x: 100, y: 200, z: -100});
});
it("should check 'setTo' method (outside)", () => {
// Given
const depaPos = this.inst.axm.get();
Expand Down

0 comments on commit 676d56b

Please sign in to comment.