[Commits] r1743 - core/trunk/geoext/tests/lib/GeoExt/widgets
commits at geoext.org
commits at geoext.org
Thu Jan 14 01:25:57 CET 2010
Author: tschaub
Date: 2010-01-14 01:25:57 +0100 (Thu, 14 Jan 2010)
New Revision: 1743
Modified:
core/trunk/geoext/tests/lib/GeoExt/widgets/LegendPanel.html
Log:
Completing the change from r1650 so that tests pass. This is a test only change. (closes #193)
Modified: core/trunk/geoext/tests/lib/GeoExt/widgets/LegendPanel.html
===================================================================
--- core/trunk/geoext/tests/lib/GeoExt/widgets/LegendPanel.html 2010-01-13 22:39:12 UTC (rev 1742)
+++ core/trunk/geoext/tests/lib/GeoExt/widgets/LegendPanel.html 2010-01-14 00:25:57 UTC (rev 1743)
@@ -38,7 +38,7 @@
var newUrl = "http://trac.geoext.org/chrome/site/img/GeoExt.png";
mapPanel.layers.getAt(0).set("legendURL", newUrl);
- var item = lp.getComponent(mapPanel.map.layers[0].id);
+ var item = lp.getComponent(lp.getIdForLayer(mapPanel.map.layers[0]));
t.ok(item instanceof GeoExt.UrlLegend, "If legendURL is found in layerRecord, UrlLegend is chosen.")
var url = item.items.get(1).getEl().dom.src;
t.eq(url, newUrl, "Update the image with the provided legendURL");
@@ -67,7 +67,7 @@
lp.render();
mapPanel.map.layers[0].setVisibility(false);
- var id = mapPanel.layers.getAt(0).get('layer').id;
+ var id = lp.getIdForLayer(mapPanel.layers.getAt(0).get('layer'));
t.eq(lp.getComponent(id).hidden, true, "Layer has been hidden in legend");
mapPanel.map.layers[0].setVisibility(true);
@@ -85,7 +85,7 @@
lp.render();
mapPanel.layers.getAt(0).set("hideInLegend", true);
- var id = mapPanel.layers.getAt(0).get('layer').id;
+ var id = lp.getIdForLayer(mapPanel.layers.getAt(0).get('layer'));
t.eq(lp.getComponent(id).hidden, true, "Layer has been hidden in legend");
lp.destroy();
@@ -118,7 +118,7 @@
lp.render();
t.eq(lp.items.length, 1, "Same number of layers in legend panel and in map");
- var item = lp.getComponent(mapPanel.map.layers[0].id);
+ var item = lp.getComponent(lp.getIdForLayer(mapPanel.map.layers[0]));
var layer;
layer = new OpenLayers.Layer.WMS("test2", '/ows', {layers: 'b', format: 'image/png', transparent: 'TRUE'});
@@ -161,7 +161,7 @@
lp.render();
var layer = mapPanel.map.layers[0];
- var cmp = lp.getComponent(layer.id);
+ var cmp = lp.getComponent(lp.getIdForLayer(layer));
t.eq(cmp.items.get(0).text, 'test', "Layer name is test before change");
layer.setName("My new name");
@@ -178,7 +178,7 @@
lp.render();
layer.setName("My new new name");
- var cmp = lp.getComponent(layer.id);
+ var cmp = lp.getComponent(lp.getIdForLayer(layer));
t.eq(cmp.items.get(0).text, "", "When showTitle is false, there is no label for a layer and it is not changed");
lp.destroy();
@@ -233,7 +233,7 @@
renderTo: "legendpanel"
});
var layer = mapPanel.map.layers[0];
- var cmp = lp.getComponent(layer.id);
+ var cmp = lp.getComponent(lp.getIdForLayer(layer));
layer.mergeNewParams({
layers: "a,b"
@@ -256,7 +256,7 @@
renderTo: 'legendpanel'});
lp.render();
- var id = mapPanel.layers.getAt(0).get('layer').id;
+ var id = lp.getIdForLayer(mapPanel.layers.getAt(0).get('layer'));
t.eq(lp.getComponent(id).hidden, true, "Layer has been hidden in legend because it is not in scale");
lp.destroy();
More information about the Commits
mailing list