From a5c5fd8d3ec2257a26e7e06e17a1a8ff69abf0dd Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Tue, 17 Apr 2012 08:20:09 +0200 Subject: [PATCH] Added tests for the 'type' property which is now inherited from the parent class. --- tests/Control/ZoomOut.html | 19 +++++++++++++++++-- tests/Control/ZoomToMaxExtent.html | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/tests/Control/ZoomOut.html b/tests/Control/ZoomOut.html index 806f928730..5345c55d13 100644 --- a/tests/Control/ZoomOut.html +++ b/tests/Control/ZoomOut.html @@ -25,6 +25,23 @@ function test_ZoomOut_constructor (t) { control.destroy(); } +function test_ZoomOut_type(t){ + t.plan( 1 ); + + // setup + var control = new OpenLayers.Control.ZoomOut(); + + // check that the type of the control equals OpenLayers.Control.TYPE_BUTTON + t.eq( + control.type, + OpenLayers.Control.TYPE_BUTTON, + 'ZoomOut-control is of type "OpenLayers.Control.TYPE_BUTTON".' + ); + + // tear down + control.destroy(); +} + function test_ZoomOut_trigger (t) { t.plan( 2 ); @@ -41,8 +58,6 @@ function test_ZoomOut_trigger (t) { }), oldZoom; - alert(map.getZoom()); - oldZoom = map.getZoom(); // tests diff --git a/tests/Control/ZoomToMaxExtent.html b/tests/Control/ZoomToMaxExtent.html index d22c24717b..674b9842a5 100644 --- a/tests/Control/ZoomToMaxExtent.html +++ b/tests/Control/ZoomToMaxExtent.html @@ -25,6 +25,23 @@ function test_ZoomToMaxExtent_constructor (t) { control.destroy(); } +function test_ZoomOut_type(t){ + t.plan( 1 ); + + // setup + var control = new OpenLayers.Control.ZoomToMaxExtent(); + + // check that the type of the control equals OpenLayers.Control.TYPE_BUTTON + t.eq( + control.type, + OpenLayers.Control.TYPE_BUTTON, + 'ZoomToMaxExtent-control is of type "OpenLayers.Control.TYPE_BUTTON".' + ); + + // tear down + control.destroy(); +} + function test_ZoomToMaxExtent_trigger (t) { t.plan( 2 );