mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 20:54:59 +08:00
df20821fd6
* extract out zoombuttons component * newline Signed-off-by: Kerry Archibald <kerrya@element.io> * stylelint Signed-off-by: Kerry Archibald <kerrya@element.io> * remove skinned sdk Signed-off-by: Kerry Archibald <kerrya@element.io>
26 lines
799 B
JavaScript
26 lines
799 B
JavaScript
const EventEmitter = require("events");
|
|
const { LngLat, NavigationControl } = require('maplibre-gl');
|
|
|
|
class MockMap extends EventEmitter {
|
|
addControl = jest.fn();
|
|
removeControl = jest.fn();
|
|
zoomIn = jest.fn();
|
|
zoomOut = jest.fn();
|
|
}
|
|
const MockMapInstance = new MockMap();
|
|
|
|
class MockGeolocateControl extends EventEmitter {
|
|
trigger = jest.fn();
|
|
}
|
|
const MockGeolocateInstance = new MockGeolocateControl();
|
|
const MockMarker = {}
|
|
MockMarker.setLngLat = jest.fn().mockReturnValue(MockMarker);
|
|
MockMarker.addTo = jest.fn().mockReturnValue(MockMarker);
|
|
module.exports = {
|
|
Map: jest.fn().mockReturnValue(MockMapInstance),
|
|
GeolocateControl: jest.fn().mockReturnValue(MockGeolocateInstance),
|
|
Marker: jest.fn().mockReturnValue(MockMarker),
|
|
LngLat,
|
|
NavigationControl
|
|
};
|