From 65466b0c270c366086a87be448c758c5e91dae27 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Sun, 16 Sep 2007 16:43:25 +0000 Subject: [PATCH] Controls need updating. This update should fix the tests from the attribution control addition. This should be fixed better -- specifying the index is the wrong way to test this. git-svn-id: http://svn.openlayers.org/trunk/openlayers@4337 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/Control/test_MouseToolbar.html | 6 +++--- tests/Control/test_NavToolbar.html | 6 +++--- tests/Control/test_OverviewMap.html | 6 +++--- tests/Control/test_PanZoom.html | 6 +++--- tests/Control/test_Permalink.html | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/Control/test_MouseToolbar.html b/tests/Control/test_MouseToolbar.html index 16c2f75574..117b96a0b0 100644 --- a/tests/Control/test_MouseToolbar.html +++ b/tests/Control/test_MouseToolbar.html @@ -17,9 +17,9 @@ t.ok( map instanceof OpenLayers.Map, "new OpenLayers.Map creates map" ); map.addControl(control); t.ok( control.map === map, "Control.map is set to the map object" ); - t.ok( map.controls[3] === control, "map.controls contains control" ); - t.eq( parseInt(control.div.style.zIndex), map.Z_INDEX_BASE['Control'] + 4, "Control div zIndexed properly" ); - t.eq( parseInt(map.viewPortDiv.lastChild.style.zIndex), map.Z_INDEX_BASE['Control'] + 4, "Viewport div contains control div" ); + t.ok( map.controls[4] === control, "map.controls contains control" ); + t.eq( parseInt(control.div.style.zIndex), map.Z_INDEX_BASE['Control'] + 5, "Control div zIndexed properly" ); + t.eq( parseInt(map.viewPortDiv.lastChild.style.zIndex), map.Z_INDEX_BASE['Control'] + 5, "Viewport div contains control div" ); t.eq( control.div.style.left, "6px", "Control div left located correctly by default"); t.eq( control.div.style.top, "300px", "Control div top located correctly by default"); diff --git a/tests/Control/test_NavToolbar.html b/tests/Control/test_NavToolbar.html index 0ffa7a83ee..7baf7a76ba 100644 --- a/tests/Control/test_NavToolbar.html +++ b/tests/Control/test_NavToolbar.html @@ -19,9 +19,9 @@ t.ok( map instanceof OpenLayers.Map, "new OpenLayers.Map creates map" ); map.addControl(control); t.ok( control.map === map, "Control.map is set to the map object" ); - t.ok( map.controls[3] === control, "map.controls contains control" ); - t.eq( parseInt(control.div.style.zIndex), map.Z_INDEX_BASE['Control'] + 6, "Control div zIndexed properly" ); - t.eq( parseInt(map.viewPortDiv.lastChild.style.zIndex), map.Z_INDEX_BASE['Control'] + 6, "Viewport div contains control div" ); + t.ok( map.controls[4] === control, "map.controls contains control" ); + t.eq( parseInt(control.div.style.zIndex), map.Z_INDEX_BASE['Control'] + 7, "Control div zIndexed properly" ); + t.eq( parseInt(map.viewPortDiv.lastChild.style.zIndex), map.Z_INDEX_BASE['Control'] + 7, "Viewport div contains control div" ); // t.eq( control.div.style.top, "6px", "Control div top located correctly by default"); } diff --git a/tests/Control/test_OverviewMap.html b/tests/Control/test_OverviewMap.html index 332e4a0883..92cd01bb94 100644 --- a/tests/Control/test_OverviewMap.html +++ b/tests/Control/test_OverviewMap.html @@ -18,9 +18,9 @@ t.ok( map instanceof OpenLayers.Map, "new OpenLayers.Map creates map" ); map.addControl(control); t.ok( control.map === map, "Control.map is set to the map object" ); - t.ok( map.controls[3] === control, "map.controls contains control" ); - t.eq( parseInt(control.div.style.zIndex), map.Z_INDEX_BASE['Control'] + 4, "Control div zIndexed properly" ); - t.eq( parseInt(map.viewPortDiv.lastChild.style.zIndex), map.Z_INDEX_BASE['Control'] + 4, "Viewport div contains control div" ); + t.ok( map.controls[4] === control, "map.controls contains control" ); + t.eq( parseInt(control.div.style.zIndex), map.Z_INDEX_BASE['Control'] + 5, "Control div zIndexed properly" ); + t.eq( parseInt(map.viewPortDiv.lastChild.style.zIndex), map.Z_INDEX_BASE['Control'] + 5, "Viewport div contains control div" ); map.destroy(); } diff --git a/tests/Control/test_PanZoom.html b/tests/Control/test_PanZoom.html index f0e968f98d..3276d39766 100644 --- a/tests/Control/test_PanZoom.html +++ b/tests/Control/test_PanZoom.html @@ -21,9 +21,9 @@ t.ok( map instanceof OpenLayers.Map, "new OpenLayers.Map creates map" ); map.addControl(control); t.ok( control.map === map, "Control.map is set to the map object" ); - t.ok( map.controls[3] === control, "map.controls contains control" ); - t.eq( parseInt(control.div.style.zIndex), map.Z_INDEX_BASE['Control'] + 4, "Control div zIndexed properly" ); - t.eq( parseInt(map.viewPortDiv.lastChild.style.zIndex), map.Z_INDEX_BASE['Control'] + 4, "Viewport div contains control div" ); + t.ok( map.controls[4] === control, "map.controls contains control" ); + t.eq( parseInt(control.div.style.zIndex), map.Z_INDEX_BASE['Control'] + 5, "Control div zIndexed properly" ); + t.eq( parseInt(map.viewPortDiv.lastChild.style.zIndex), map.Z_INDEX_BASE['Control'] + 5, "Viewport div contains control div" ); t.eq( control.div.style.top, "4px", "Control div top located correctly by default"); var control2 = new OpenLayers.Control.PanZoom(); diff --git a/tests/Control/test_Permalink.html b/tests/Control/test_Permalink.html index 9b924e0b7b..5b9342c136 100644 --- a/tests/Control/test_Permalink.html +++ b/tests/Control/test_Permalink.html @@ -65,7 +65,7 @@ t.ok( control instanceof OpenLayers.Control.Permalink, "new OpenLayers.Control returns object" ); map = new OpenLayers.Map('map'); map.addControl(control); - t.eq(map.controls[3].div.firstChild.nodeName, "A", "Permalink control creates div with 'a' inside." ); + t.eq(map.controls[4].div.firstChild.nodeName, "A", "Permalink control creates div with 'a' inside." ); } function test_05_Control_Permalink_base_with_query (t) { t.plan( 3 );