Add tests for ol.Overlay.setVisible

This commit is contained in:
Frederic Junod
2017-01-23 16:19:10 +01:00
parent 0ff0c9aa9f
commit 7f39b22161

View File

@@ -75,4 +75,29 @@ describe('ol.Overlay', function() {
});
describe('#setVisible()', function() {
var overlay, target;
beforeEach(function() {
target = document.createElement('div');
});
afterEach(function() {
map.removeOverlay(overlay);
});
it('changes the CSS display value', function() {
overlay = new ol.Overlay({
element: target,
position: [0, 0]
});
map.addOverlay(overlay);
expect(overlay.element_.style.display).to.be('none');
overlay.setVisible(true);
expect(overlay.element_.style.display).not.to.be('none');
overlay.setVisible(false);
expect(overlay.element_.style.display).to.be('none');
});
});
});