X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/bf797f438037c800673df8314449e118c31e0d73..5153244f5d15d7a943aaee4d4147aec28e8a1566:/test/javascripts/osm_test.js?ds=inline diff --git a/test/javascripts/osm_test.js b/test/javascripts/osm_test.js index 5e982fc4d..ad4cc7b9f 100644 --- a/test/javascripts/osm_test.js +++ b/test/javascripts/osm_test.js @@ -1,10 +1,11 @@ //= require jquery -//= require jquery.cookie +//= require jquery.cookie/jquery.cookie //= require osm -//= require leaflet -//= require querystring - -var querystring = require('querystring-component'); +//= require leaflet/dist/leaflet-src +//= require leaflet.osm +//= require leaflet.map +//= require i18n/translations +//= require qs/dist/qs describe("OSM", function () { describe(".apiUrl", function () { @@ -70,18 +71,8 @@ describe("OSM", function () { expect(params).to.have.property("bounds").deep.equal(expected); }); - it("parses lat/lon/zoom params", function () { - var params = OSM.mapParams("?lat=57.6247&lon=-3.6845"); - expect(params).to.have.property("lat", 57.6247); - expect(params).to.have.property("lon", -3.6845); - expect(params).to.have.property("zoom", 5); - - params = OSM.mapParams("?lat=57.6247&lon=-3.6845&zoom=10"); - expect(params).to.have.property("lat", 57.6247); - expect(params).to.have.property("lon", -3.6845); - expect(params).to.have.property("zoom", 10); - - params = OSM.mapParams("?mlat=57.6247&mlon=-3.6845"); + it("parses mlat/mlon/zoom params", function () { + var params = OSM.mapParams("?mlat=57.6247&mlon=-3.6845"); expect(params).to.have.property("lat", 57.6247); expect(params).to.have.property("lon", -3.6845); expect(params).to.have.property("zoom", 12); @@ -227,4 +218,33 @@ describe("OSM", function () { expect(OSM.zoomPrecision(20)).to.eq(5); }); }); + + describe(".locationCookie", function () { + it("creates a location cookie value", function () { + $("body").html($("