Fix map tests
This commit is contained in:
@@ -816,7 +816,7 @@ describe('ol/Map', function () {
|
|||||||
|
|
||||||
it('removes window listeners', function () {
|
it('removes window listeners', function () {
|
||||||
map.dispose();
|
map.dispose();
|
||||||
expect(map.handleResize_).to.be(undefined);
|
expect(map.targetChangeHandlerKeys_).to.be(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -828,7 +828,7 @@ describe('ol/Map', function () {
|
|||||||
map = new Map({
|
map = new Map({
|
||||||
target: document.createElement('div'),
|
target: document.createElement('div'),
|
||||||
});
|
});
|
||||||
expect(map.handleResize_).to.be.ok();
|
expect(map.targetChangeHandlerKeys_).to.be.ok();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('map with target not attached to dom', function () {
|
describe('map with target not attached to dom', function () {
|
||||||
@@ -840,7 +840,7 @@ describe('ol/Map', function () {
|
|||||||
describe('call setTarget with null', function () {
|
describe('call setTarget with null', function () {
|
||||||
it('unregisters the viewport resize listener', function () {
|
it('unregisters the viewport resize listener', function () {
|
||||||
map.setTarget(null);
|
map.setTarget(null);
|
||||||
expect(map.handleResize_).to.be(undefined);
|
expect(map.targetChangeHandlerKeys_).to.be(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -848,7 +848,7 @@ describe('ol/Map', function () {
|
|||||||
it('registers a viewport resize listener', function () {
|
it('registers a viewport resize listener', function () {
|
||||||
map.setTarget(null);
|
map.setTarget(null);
|
||||||
map.setTarget(document.createElement('div'));
|
map.setTarget(document.createElement('div'));
|
||||||
expect(map.handleResize_).to.be.ok();
|
expect(map.targetChangeHandlerKeys_).to.be.ok();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -877,8 +877,14 @@ describe('ol/Map', function () {
|
|||||||
hasAttribute: function (attribute) {
|
hasAttribute: function (attribute) {
|
||||||
return hasTabIndex;
|
return hasTabIndex;
|
||||||
},
|
},
|
||||||
|
contains: function () {
|
||||||
|
return hasFocus;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
getOwnerDocument: function () {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
originalEvent: {
|
originalEvent: {
|
||||||
isPrimary: isPrimary,
|
isPrimary: isPrimary,
|
||||||
|
|||||||
Reference in New Issue
Block a user