//= require leaflet/dist/leaflet-src
//= require leaflet.osm
//= require leaflet.map
-//= require i18n/translations
describe("OSM", function () {
describe(".apiUrl", function () {
});
});
- describe(".params", function () {
- it("parses params", function () {
- const params = OSM.params("?foo=a&bar=b");
- expect(params).to.have.property("foo", "a");
- expect(params).to.have.property("bar", "b");
- });
- });
-
describe(".mapParams", function () {
beforeEach(function () {
delete OSM.home;
describe(".locationCookie", function () {
it("creates a location cookie value", function () {
- $("body").html($("<div id='map'>"));
+ $("body").append("<div id='map'>");
const map = new L.OSM.Map("map", { center: [57.6247, -3.6845], zoom: 9 });
map.updateLayers("");
expect(OSM.locationCookie(map)).to.eq("-3.685|57.625|9|M");
+ $("#map").remove();
});
it("respects zoomPrecision", function () {
- $("body").html($("<div id='map'>"));
+ $("body").append("<div id='map'>");
const map = new L.OSM.Map("map", { center: [57.6247, -3.6845], zoom: 9 });
map.updateLayers("");
expect(OSM.locationCookie(map)).to.eq("-3.685|57.625|9|M");
// using map._zoom here to update the zoom level manually
map._zoom = 5;
expect(OSM.locationCookie(map)).to.eq("-3.68|57.62|5|M");
+ $("#map").remove();
});
});