Refactored many helpers to Typescript

This commit is contained in:
Alejandro Celaya
2020-08-22 18:32:48 +02:00
parent 7c67fa4149
commit 62df46d648
18 changed files with 145 additions and 113 deletions

View File

@@ -0,0 +1,19 @@
import L from 'leaflet';
import marker2x from 'leaflet/dist/images/marker-icon-2x.png';
import marker from 'leaflet/dist/images/marker-icon.png';
import markerShadow from 'leaflet/dist/images/marker-shadow.png';
import { fixLeafletIcons } from '../../../src/utils/helpers/leaflet';
describe('leaflet', () => {
describe('fixLeafletIcons', () => {
it('updates icons used by leaflet', () => {
fixLeafletIcons();
const { iconRetinaUrl, iconUrl, shadowUrl } = L.Icon.Default.prototype.options;
expect(iconRetinaUrl).toEqual(marker2x);
expect(iconUrl).toEqual(marker);
expect(shadowUrl).toEqual(markerShadow);
});
});
});