Skip to content

Commit 27be9e1

Browse files
committed
add unit test to check that getBounds returns the inset with padding
1 parent e4b25b8 commit 27be9e1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/unit/ui/map.test.js

+18
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,24 @@ test('Map', (t) => {
702702
t.end();
703703
});
704704

705+
t.test('padded bounds', (t) => {
706+
const map = createMap(t, {zoom: 1, bearing: 45, skipCSSStub: true, skipAuthenticateStub: true});
707+
708+
map.setPadding({
709+
left: 100,
710+
right: 10,
711+
top: 10,
712+
bottom: 10
713+
});
714+
715+
t.deepEqual(
716+
toFixed([[-33.5599507477, -31.7907658998], [33.5599507477, 31.7907658998]]),
717+
toFixed(map.getBounds().toArray())
718+
);
719+
720+
t.end();
721+
});
722+
705723
t.end();
706724

707725
function toFixed(bounds) {

0 commit comments

Comments
 (0)