Leaflet/spec/suites/layer/ImageOverlaySpec.js
Fabrizio Minuti 93c2b52604 fix imageoverlay setBound when not added to map
If imageoverlay#setBounds is called when the layer is not added to a
map, the _reset method gets errors on execution
2015-07-28 12:10:40 +02:00

18 lines
506 B
JavaScript

describe('ImageOverlay', function () {
describe('#setStyle', function () {
it('sets opacity', function () {
var overlay = L.imageOverlay().setStyle({opacity: 0.5});
expect(overlay.options.opacity).to.equal(0.5);
});
});
describe('#setBounds', function () {
it('sets bounds', function () {
var bounds = new L.LatLngBounds(
new L.LatLng(14, 12),
new L.LatLng(30, 40));
var overlay = L.imageOverlay().setBounds(bounds);
expect(overlay._bounds).to.equal(bounds);
});
});
});