Files
carto.js/test/spec/geo/geometry-views/shared-tests-for-multi-point-views.js
2020-06-13 18:34:34 +08:00

28 lines
771 B
JavaScript

var MultiPoint = require('../../../../src/geo/geometry-models/multi-point');
var SharedTestsForMultiGeometryViews = require('./shared-tests-for-multi-geometry-views');
var createMapView = require('./create-map-view');
module.exports = function (MapView, MultiPointView) {
beforeEach(function () {
this.geometry = new MultiPoint(null, {
latlngs: [
[0, 1],
[1, 2]
]
});
this.mapView = createMapView(MapView);
this.mapView.render();
this.geometryView = new MultiPointView({
model: this.geometry,
mapView: this.mapView
});
});
SharedTestsForMultiGeometryViews.call(this);
it('should render the geometries', function () {
expect(this.mapView.getMarkers().length).toEqual(2); // 2 points
});
};