From 349ffa2fed961e484385f578689867e39b04e80e Mon Sep 17 00:00:00 2001 From: Stepan Kuzmin Date: Wed, 25 Jul 2018 16:32:08 +0300 Subject: [PATCH] fix map initial bounds test #1970 --- test/unit/ui/map.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/unit/ui/map.test.js b/test/unit/ui/map.test.js index b9a5c3fa49b..01ad45bb42d 100755 --- a/test/unit/ui/map.test.js +++ b/test/unit/ui/map.test.js @@ -54,8 +54,12 @@ test('Map', (t) => { }); t.test('initial bounds in constructor options', (t) => { + const container = window.document.createElement('div'); + Object.defineProperty(container, 'offsetWidth', {value: 512}); + Object.defineProperty(container, 'offsetHeight', {value: 512}); + const bounds = [[-133, 16], [-68, 50]]; - const map = createMap({bounds}); + const map = createMap(t, {container, bounds}); t.deepEqual(fixedLngLat(map.getCenter(), 4), { lng: -100.5, lat: 34.7171 }); t.equal(fixedNum(map.getZoom(), 3), 2.469);