[Pkg-javascript-commits] [leaflet] 64/301: added a spec test for worldCopyJump set Center and Zoom fix #1982
Jonas Smedegaard
js at moszumanska.debian.org
Mon Jan 27 22:22:42 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository leaflet.
commit a8a8ebe309699b308230b4df8e7d23ee22985412
Author: fastrde <strachanski at googlemail.com>
Date: Sun Aug 18 03:18:21 2013 +0200
added a spec test for worldCopyJump set Center and Zoom fix #1982
---
spec/index.html | 3 +++
spec/suites/map/handler/Map.DragSpec.js | 40 +++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+)
diff --git a/spec/index.html b/spec/index.html
index 6454bc2..2c65a21 100644
--- a/spec/index.html
+++ b/spec/index.html
@@ -74,6 +74,9 @@
<!-- /map -->
<script type="text/javascript" src="suites/map/MapSpec.js"></script>
+ <!-- /map/handler -->
+ <script type="text/javascript" src="suites/map/handler/Map.DragSpec.js"></script>
+
<script>
(window.mochaPhantomJS || window.mocha).run();
</script>
diff --git a/spec/suites/map/handler/Map.DragSpec.js b/spec/suites/map/handler/Map.DragSpec.js
new file mode 100644
index 0000000..57b50a7
--- /dev/null
+++ b/spec/suites/map/handler/Map.DragSpec.js
@@ -0,0 +1,40 @@
+describe("Map.Drag", function(){
+ var map;
+
+ describe("#addHook", function () {
+ it("calls the map with dragging enabled", function () {
+ var container = document.createElement('div'),
+ map = new L.Map(container,{
+ dragging: true
+ });
+ expect(map.dragging.enabled()).to.be(true);
+ map.setView([0, 0], 0);
+ expect(map.dragging.enabled()).to.be(true);
+ });
+ it("calls the map with dragging and worldCopyJump enabled", function () {
+ var container = document.createElement('div'),
+
+ map = new L.Map(container,{
+ dragging: true,
+ worldCopyJump: true
+ });
+ expect(map.dragging.enabled()).to.be(true);
+ map.setView([0, 0], 0);
+ expect(map.dragging.enabled()).to.be(true);
+ });
+ it("calls the map with dragging disabled and worldCopyJump enabled. Enables dragging after setting center and zoom", function () {
+ var container = document.createElement('div'),
+
+ map = new L.Map(container,{
+ dragging: false,
+ worldCopyJump: true
+ });
+ expect(map.dragging.enabled()).to.be(false);
+ map.setView([0, 0], 0);
+ map.dragging.enable();
+ expect(map.dragging.enabled()).to.be(true);
+ });
+
+ });
+
+});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet.git
More information about the Pkg-javascript-commits
mailing list