|
@@ -44,3 +44,35 @@ test('MapWidget.getControls', function(assert) {
|
|
|
assert.equal(widget.controls[1].displayClass, 'olControlDrawFeaturePoint', 'Draw control');
|
|
|
assert.equal(widget.controls[2].displayClass, 'olControlModifyFeature', 'Modify control');
|
|
|
});
|
|
|
+
|
|
|
+test('MapWidget.IsCollection', function(assert) {
|
|
|
+ var options = {id: 'id_point', map_id: 'id_point_map', geom_name: 'Point'};
|
|
|
+ var widget = new MapWidget(options);
|
|
|
+ assert.notOk(widget.options.is_collection);
|
|
|
+
|
|
|
+ document.getElementById('id_point').value = "";
|
|
|
+
|
|
|
+ options.geom_name = 'Polygon';
|
|
|
+ widget = new MapWidget(options);
|
|
|
+ assert.notOk(widget.options.is_collection);
|
|
|
+
|
|
|
+ options.geom_name = 'LineString';
|
|
|
+ widget = new MapWidget(options);
|
|
|
+ assert.notOk(widget.options.is_collection);
|
|
|
+
|
|
|
+ options.geom_name = 'MultiPoint';
|
|
|
+ widget = new MapWidget(options);
|
|
|
+ assert.ok(widget.options.is_collection);
|
|
|
+
|
|
|
+ options.geom_name = 'MultiPolygon';
|
|
|
+ widget = new MapWidget(options);
|
|
|
+ assert.ok(widget.options.is_collection);
|
|
|
+
|
|
|
+ options.geom_name = 'MultiLineString';
|
|
|
+ widget = new MapWidget(options);
|
|
|
+ assert.ok(widget.options.is_collection);
|
|
|
+
|
|
|
+ options.geom_name = 'GeometryCollection';
|
|
|
+ widget = new MapWidget(options);
|
|
|
+ assert.ok(widget.options.is_collection);
|
|
|
+});
|