Skip to content

Commit

Permalink
Update leaflet-rotate.spec.js with setView check on bering change (#53)
Browse files Browse the repository at this point in the history
* Update leaflet-rotate.spec.js

* Update examples/leaflet-rotate.spec.js

Fixing as per update.

Co-authored-by: Raruto <[email protected]>

* Update leaflet-rotate.spec.js

---------

Co-authored-by: Raruto <[email protected]>
  • Loading branch information
ragavendra and Raruto authored May 17, 2024
1 parent 3dc2951 commit e40d9a5
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion examples/leaflet-rotate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ test('set bearing and zoom in/out', async ({ page }) => {
assert.is(bearing_2, 10);
});

// assertion fails for second setView
test('set bearing and set view', async ({ page }) => {
const { bearing_0, bearing_1, bearing_2 } = await page.evaluate(() => new Promise(resolve => {
let bearing_0, bearing_1, bearing_2;
map.setBearing(10); bearing_0 = map.getBearing();
map.setView({ lat: 50.5, lng: 30.5 }, 15, {}); bearing_1 = map.getBearing();
map.setView({ lat: 51.5, lng: 34.5 }, 17, {}); bearing_2 = map.getBearing();
resolve({ bearing_0, bearing_1, bearing_2 });
}));
assert.is(bearing_0, 10);
assert.is(bearing_1, 10);
assert.is(bearing_2, 10);
});

/**
* @see https://github.com/Raruto/leaflet-rotate/issues/25
*/
Expand Down Expand Up @@ -124,4 +138,4 @@ test('draggable marker drag/dragEnd should have only one listener', async ({ pag
assert.is(dragEndListeners.length, 1);
});

test.run();
test.run();

0 comments on commit e40d9a5

Please sign in to comment.