Skip to content

Commit

Permalink
Changed test to show that controlWithLayer.layer has changed type fro…
Browse files Browse the repository at this point in the history
…m OpenLayers.Layer.Vector to OpenLayers.Layer.Vector.RootContainer
  • Loading branch information
emoen committed Apr 9, 2014
1 parent b751558 commit a879c7d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/Control/SelectFeature.html
Expand Up @@ -625,7 +625,7 @@
}

function test_addLayer(t) {
t.plan(4);
t.plan(5);

var layer = new OpenLayers.Layer.Vector();
var layers = [new OpenLayers.Layer.Vector(), new OpenLayers.Layer.Vector()]
Expand All @@ -634,14 +634,16 @@
var controlWithLayer = new OpenLayers.Control.SelectFeature(layer);
var controlWithLayers = new OpenLayers.Control.SelectFeature(layers);

t.ok(controlWithLayer.layer instanceof OpenLayers.Layer.Vector, "layer is an instance of OpenLayers.Layer.Vector");

controlWithLayer.addLayer(layerToAdd);
controlWithLayers.addLayer(layerToAdd);

t.eq(controlWithLayer.layers.length, 2, "the added layer is added and all layers are active");
t.eq(controlWithLayers.layers.length, 3, "the added layer is added and all layers are active");

t.eq(controlWithLayer.layer.length, null, "layer is empty");
t.eq(controlWithLayers.layer.length, null, "layer is empty");
t.ok(controlWithLayer.layer instanceof OpenLayers.Layer.Vector.RootContainer, "layer has changed from OpenLayers.Layer.Vector to OpenLayers.Layer.Vector.RootContainer");
t.ok(controlWithLayers.layer instanceof OpenLayers.Layer.Vector.RootContainer, "layer still a OpenLayers.Layer.Vector.RootContainer");
}

</script>
Expand Down

0 comments on commit a879c7d

Please sign in to comment.