Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable animations outside dom #1856

Merged
merged 4 commits into from
Jul 11, 2013
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
PosAnimation tests
  • Loading branch information
Aaron Rutkovsky committed Jul 11, 2013
commit 0e34b8caf20c242758c1853252a628b47020ef4d
27 changes: 27 additions & 0 deletions spec/suites/dom/PosAnimationSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
describe('PosAnimation', function() {
var el;

beforeEach(function() {
el = document.createElement('div');
this.subject = new L.PosAnimation();
this.subject._el = el;
});

describe('#_onStep', function() {
it("sets element position and fires step event if it is able to get current position", function() {
var point = new L.Point(5, 5, true);
sinon.stub(this.subject, '_getPos').returns(point);
this.subject.fire = sinon.stub();
this.subject._onStep();
expect(this.subject.fire.withArgs('step').calledOnce).to.be(true);
expect(this.subject._el._leaflet_pos).to.be(point);
});

it('stops transition if a position returned', function() {
sinon.stub(this.subject, '_onTransitionEnd');
sinon.stub(this.subject, '_getPos').returns(undefined);
this.subject._onStep();
expect(this.subject._onTransitionEnd.calledOnce).to.be(true);
});
});
});