Remove use of goog.dom.createDom
This commit is contained in:
@@ -7,7 +7,7 @@ describe('ol.control.Control', function() {
|
||||
map = new ol.Map({
|
||||
target: document.createElement('div')
|
||||
});
|
||||
var element = goog.dom.createDom('DIV');
|
||||
var element = document.createElement('DIV');
|
||||
control = new ol.control.Control({element: element});
|
||||
control.setMap(map);
|
||||
});
|
||||
@@ -27,14 +27,16 @@ describe('ol.control.Control', function() {
|
||||
describe('ol.control.Control\'s target', function() {
|
||||
describe('target as string or element', function() {
|
||||
it('transforms target from string to element', function() {
|
||||
var target = goog.dom.createDom('div', {'id': 'mycontrol'});
|
||||
var target = document.createElement('div');
|
||||
target.id = 'mycontrol';
|
||||
document.body.appendChild(target);
|
||||
var ctrl = new ol.control.Control({target: 'mycontrol'});
|
||||
expect(ctrl.target_.id).to.equal('mycontrol');
|
||||
goog.dispose(ctrl);
|
||||
});
|
||||
it('accepts element for target', function() {
|
||||
var target = goog.dom.createDom('div', {'id': 'mycontrol'});
|
||||
var target = document.createElement('div');
|
||||
target.id = 'mycontrol';
|
||||
document.body.appendChild(target);
|
||||
var ctrl = new ol.control.Control({target: target});
|
||||
expect(ctrl.target_.id).to.equal('mycontrol');
|
||||
|
||||
@@ -7,6 +7,15 @@ describe('ol.control.MousePosition', function() {
|
||||
it('can be constructed without arguments', function() {
|
||||
var instance = new ol.control.MousePosition();
|
||||
expect(instance).to.be.an(ol.control.MousePosition);
|
||||
expect(instance.element.className).to.be('ol-mouse-position');
|
||||
});
|
||||
|
||||
it('creates the element with the provided class name', function() {
|
||||
var className = 'foobar';
|
||||
var instance = new ol.control.MousePosition({
|
||||
className: className
|
||||
});
|
||||
expect(instance.element.className).to.be(className);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user