mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-08-01 07:28:40 +00:00
@ -275,6 +275,31 @@ describe("Map", function () {
|
||||
});
|
||||
});
|
||||
|
||||
describe("#stop", function () {
|
||||
it("does not try to stop the animation if it wasn't set before", function () {
|
||||
map.setView([50, 50], 10);
|
||||
map.stop = sinon.spy();
|
||||
map.panTo([10, 10], 10);
|
||||
expect(map.stop.called).to.not.be.ok();
|
||||
});
|
||||
|
||||
it("stops the execution of the flyTo animation", function () {
|
||||
map.setView([0, 0]);
|
||||
map.stop = sinon.spy();
|
||||
map.flyTo([51.505, -0.09]);
|
||||
map.stop();
|
||||
expect(map.stop.calledOnce).to.be.ok();
|
||||
});
|
||||
|
||||
it("stops the execution of the panTo animation", function () {
|
||||
map.setView([0, 0]);
|
||||
map.stop = sinon.spy();
|
||||
map.panTo([51.505, -0.09]);
|
||||
map.stop();
|
||||
expect(map.stop.calledOnce).to.be.ok();
|
||||
});
|
||||
});
|
||||
|
||||
describe("#setZoomAround", function () {
|
||||
beforeEach(function () {
|
||||
map.setView([0, 0], 0); // loads map
|
||||
|
Reference in New Issue
Block a user