Files
openlayers/test/spec/ol/control/control.test.js
Éric Lemoine b6ed5f2164 Use namespaces for tests
With this commit test files provide namespaces (using goog.provide). This fixes the issue reported by @bartvde where goog objects cannot be used in Jasmine "describe" functions. It also frees us from having to add script tags for the test files in test/ol.html.
2013-01-31 10:18:21 +01:00

30 lines
711 B
JavaScript

goog.provide('ol.test.control.Control');
describe('ol.control.Control', function() {
var map, control;
beforeEach(function() {
map = new ol.Map({
target: document.getElementById('map')
});
var element = goog.dom.createDom(goog.dom.TagName.DIV);
control = new ol.control.Control({element: element});
control.setMap(map);
});
afterEach(function() {
map.dispose();
});
describe('dispose', function() {
it('removes the control element from its parent', function() {
control.dispose();
expect(goog.dom.getParentElement(control.element)).toBeNull();
});
});
});
goog.require('goog.dom');
goog.require('ol.Map');
goog.require('ol.control.Control');