Invalid size set when map is not added to document
Parsing of an empty string with parseFloat resulted in NaN.
This commit is contained in:
@@ -687,6 +687,7 @@ describe('ol.Map', function () {
|
||||
});
|
||||
|
||||
describe('#setTarget', function () {
|
||||
/** @type {Map|undefined} */
|
||||
let map;
|
||||
|
||||
beforeEach(function () {
|
||||
@@ -696,6 +697,12 @@ describe('ol.Map', function () {
|
||||
expect(map.handleResize_).to.be.ok();
|
||||
});
|
||||
|
||||
describe('map with target not attached to dom', function () {
|
||||
it('has undefined as size with target not in document', function () {
|
||||
expect(map.getSize()).to.be(undefined);
|
||||
});
|
||||
});
|
||||
|
||||
describe('call setTarget with null', function () {
|
||||
it('unregisters the viewport resize listener', function () {
|
||||
map.setTarget(null);
|
||||
|
||||
Reference in New Issue
Block a user