Raruto / leaflet-rotate

Leaflet plugin that allows to add rotation functionality to map tiles
GNU General Public License v3.0
81 stars 23 forks source link

Add test: `'set bearing and set view'` within `examples/leaflet-rotate.spec.js` #53

Closed ragavendra closed 5 months ago

ragavendra commented 6 months ago

New test: examples/leaflet-rotate.spec.js

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);
});