Leaflet/spec/suites/layer/marker/Icon.DefaultSpec.js
Iván Sánchez Ortega e9957cfa02 Detect L.Icon.Default.imagePath using CSS. #4604, #3696, #4579 (#4605)
* CSS-based paths for L.Icon.Default. #4604, #3696, #4579

* Unit tests for default icons

* Make CSS icon path detection IE8-friendly

* Backwards compatibility for L.Icon.Default.imagePath override.

* Don't overwrite options
2016-08-22 16:40:03 +02:00

34 lines
884 B
JavaScript

describe("Icon.Default", function () {
it("icon measures 25x41px", function () {
var div = document.createElement('div');
div.style.height = '100px';
document.body.appendChild(div);
var map = L.map(div).setView([0, 0], 0);
var marker = new L.Marker([0, 0]).addTo(map);
var img = map.getPane('markerPane').querySelector('img');
expect(img.clientHeight).to.be(41);
expect(img.clientWidth).to.be(25);
document.body.removeChild(div);
});
it("shadow measures 41x41px", function () {
var div = document.createElement('div');
div.style.height = '100px';
document.body.appendChild(div);
var map = L.map(div).setView([0, 0], 0);
var marker = new L.Marker([0, 0]).addTo(map);
var img = map.getPane('shadowPane').querySelector('img');
expect(img.clientHeight).to.be(41);
expect(img.clientWidth).to.be(41);
document.body.removeChild(div);
});
});