From 8872f4874ce87261a662efffc5d4981f9b310639 Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Mon, 11 Jun 2018 20:16:45 +1000 Subject: [PATCH] add unit test --- test/unit/ui/map.test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/unit/ui/map.test.js b/test/unit/ui/map.test.js index 1d630ef4fd1..99859ac6458 100755 --- a/test/unit/ui/map.test.js +++ b/test/unit/ui/map.test.js @@ -1447,6 +1447,21 @@ test('Map', (t) => { t.end(); }); + t.test('continues camera animation on resize', (t) => { + const map = createMap(), + container = map.getContainer(); + + map.flyTo({ center: [200, 0], duration: 100 }); + + Object.defineProperty(container, 'offsetWidth', {value: 250}); + Object.defineProperty(container, 'offsetHeight', {value: 250}); + map.resize(); + + t.ok(map.isMoving(), 'map is still moving after resize due to camera animation'); + + t.end(); + }); + t.end(); });