diff options
| author | Claude Paroz <claude@2xlibre.net> | 2016-07-30 22:08:50 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2016-07-31 20:38:29 +0200 |
| commit | f530b4fdfc2be3c2a0edcf38ebeb12bb5a4f0b83 (patch) | |
| tree | 44c89645f47e9d798be0e04a609fa845b3954d90 /js_tests | |
| parent | 5fa4370543658aedd79dc554d8c52684d6c7cbca (diff) | |
Fixed #26972 -- Fixed is_collection definition in MapWidget initialization
Diffstat (limited to 'js_tests')
| -rw-r--r-- | js_tests/gis/mapwidget.test.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/js_tests/gis/mapwidget.test.js b/js_tests/gis/mapwidget.test.js index c46823c9b9..716e6eca8b 100644 --- a/js_tests/gis/mapwidget.test.js +++ b/js_tests/gis/mapwidget.test.js @@ -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); + // Empty the default initial Point + 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); +}); |
