Skip to content

Commit

Permalink
fix tests for #5406
Browse files Browse the repository at this point in the history
  • Loading branch information
pjamessteven committed Jan 30, 2025
1 parent 7f33fbf commit a1b2b5d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ui/camera.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3170,15 +3170,14 @@ describe('#flyTo globe projection', () => {

test('immediately sets padding with duration = 0', () => {
const camera = createCameraGlobe();
camera.easeTo({center: [100, 0], duration: 0, padding: {left: 100}});
camera.flyTo({center: [100, 0], duration: 0, padding: {left: 100}});
expect(camera.getPadding()).toEqual({
bottom: 0,
left: 100,
right: 0,
top: 0,
});

expect(camera.getCenter()).toEqual({lng: 100, lat: 0});
});

test('smoothly sets given padding with duration > 0', async () => {
Expand All @@ -3190,7 +3189,7 @@ describe('#flyTo globe projection', () => {

camera.flyTo({center: [100, 0], duration: 100, padding: {left: 100}});

stub.mockImplementation(() => 50);
stub.mockImplementation(() => 100);
camera.simulateFrame();

const padding = camera.getPadding();
Expand Down

0 comments on commit a1b2b5d

Please sign in to comment.