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:40:17 +0200 |
| commit | 39387efbba11ea964d3aab69bf26899fe874f5f6 (patch) | |
| tree | 2e0b5a8087adba97b407fdc81f63a5f8d646ee73 /js_tests | |
| parent | 83b950e9ffd4904500bb9dcc9c7526f4d7899853 (diff) | |
[1.10.x] Fixed #26972 -- Fixed is_collection definition in MapWidget initialization
Backport of f530b4fdfc2be3c2a0edcf38ebeb12bb5a4f0b83 from master.
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); +}); |
