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 Jul 25, 2018
1 parent 3072990 commit bb24c7d
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 @@ -55,8 +55,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 bb24c7d

Please sign in to comment.