Assert each layer is only added to the map once

This commit is contained in:
Andreas Hocevar
2020-01-24 16:05:58 +01:00
parent 97cb0bbd77
commit 1ee03decdd
3 changed files with 14 additions and 3 deletions

View File

@@ -631,8 +631,7 @@ describe('ol.layer.Layer', function() {
map: map
});
frameState = {
layerStatesArray: [],
layerStates: {}
layerStatesArray: []
};
});
@@ -651,6 +650,7 @@ describe('ol.layer.Layer', function() {
layer.setZIndex(index);
map.dispatchEvent(new RenderEvent('precompose', null, frameState, null));
const layerState = frameState.layerStatesArray[0];
frameState.layerStatesArray.length = 0;
expect(layerState.zIndex).to.be(index);
});
});