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.
30 lines
711 B
JavaScript
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');
|