From b2d2f44f43b9605ffab244693cf0c5ed97e6829f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Kr=C3=B6g?= Date: Sun, 31 Jul 2022 18:25:07 +0200 Subject: [PATCH] No need to wait for postrender in Map test --- test/browser/spec/ol/Map.test.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/test/browser/spec/ol/Map.test.js b/test/browser/spec/ol/Map.test.js index a6ca16fcd0..5bf76232f5 100644 --- a/test/browser/spec/ol/Map.test.js +++ b/test/browser/spec/ol/Map.test.js @@ -1070,29 +1070,24 @@ describe('ol/Map', function () { expect(spy.callCount).to.be(0); }); - it('calls renderFrame_ and results in an postrender event', function (done) { + it('calls renderFrame_ and results in a postrender event', function (done) { const spy = sinon.spy(map, 'renderFrame_'); map.render(); map.once('postrender', function (event) { expect(event).to.be.a(MapEvent); expect(typeof spy.firstCall.args[0]).to.be('number'); spy.restore(); - const frameState = event.frameState; - expect(frameState).not.to.be(null); + expect(event.frameState).not.to.be(null); done(); }); }); - it('uses the same render frame for subsequent calls', function (done) { + it('uses the same render frame for subsequent calls', function () { map.render(); const id1 = map.animationDelayKey_; - let id2 = null; - map.once('postrender', function () { - expect(id2).to.be(id1); - done(); - }); map.render(); - id2 = map.animationDelayKey_; + const id2 = map.animationDelayKey_; + expect(id1).to.be(id2); }); it('creates a new render frame after renderSync()', function (done) {