Skip to content

Commit

Permalink
fix map initial bounds test #1970
Browse files Browse the repository at this point in the history
  • Loading branch information
stepankuzmin committed Aug 9, 2018
1 parent 7d7f486 commit 349ffa2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/unit/ui/map.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 349ffa2

Please sign in to comment.