Fix layer zIndex test with falsy values

This commit is contained in:
Frederic Junod
2019-10-31 15:58:35 +01:00
parent c23d59e3a8
commit b8c70bcbe7
2 changed files with 8 additions and 5 deletions

View File

@@ -650,10 +650,12 @@ describe('ol.layer.Layer', function() {
});
it('respects the configured zIndex', function() {
layer.setZIndex(42);
map.dispatchEvent(new RenderEvent('precompose', null, frameState, null));
const layerState = frameState.layerStatesArray[0];
expect(layerState.zIndex).to.be(42);
[-5, 0, 42].forEach(index => {
layer.setZIndex(index);
map.dispatchEvent(new RenderEvent('precompose', null, frameState, null));
const layerState = frameState.layerStatesArray[0];
expect(layerState.zIndex).to.be(index);
});
});
});