[Commits] r759 - in sandbox/elemoine/playground/geoext/tests: . lib/GeoExt/widgets
commits at geoext.org
commits at geoext.org
Fri May 15 15:25:05 CEST 2009
Author: elemoine
Date: 2009-05-15 15:25:05 +0200 (Fri, 15 May 2009)
New Revision: 759
Added:
sandbox/elemoine/playground/geoext/tests/lib/GeoExt/widgets/Action.html
Modified:
sandbox/elemoine/playground/geoext/tests/list-tests.html
Log:
test GeoExt.Action.fromControl
Added: sandbox/elemoine/playground/geoext/tests/lib/GeoExt/widgets/Action.html
===================================================================
--- sandbox/elemoine/playground/geoext/tests/lib/GeoExt/widgets/Action.html (rev 0)
+++ sandbox/elemoine/playground/geoext/tests/lib/GeoExt/widgets/Action.html 2009-05-15 13:25:05 UTC (rev 759)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html debug="true">
+ <head>
+ <script type="text/javascript" src="../../../../../openlayers/lib/OpenLayers.js"></script>
+ <script type="text/javascript" src="../../../../../ext/adapter/ext/ext-base.js"></script>
+ <script type="text/javascript" src="../../../../../ext/ext-all-debug.js"></script>
+ <script type="text/javascript" src="../../../../lib/GeoExt.js"></script>
+
+ <script type="text/javascript">
+ function test_fromControl(t) {
+ t.plan(4);
+
+ var ctrl, action, cfg;
+
+ ctrl = new OpenLayers.Control();
+
+ // 2 tests
+ action = GeoExt.Action.fromControl(ctrl);
+ t.ok(action instanceof Ext.Action,
+ "fromControl return an Ext.Action instance");
+ t.ok(action.control == ctrl,
+ "fromControl sets the control in the returned instance");
+
+ // 1 test
+ cfg = {text: "foo"};
+ action = new GeoExt.Action.fromControl(ctrl, cfg);
+ t.ok(action.initialConfig == cfg,
+ "fromControl sets the config in the instance's initial config");
+
+ // 1 test
+ var a = new Ext.Action({text: "foo"});
+ action = new GeoExt.Action.fromControl(ctrl, a);
+ t.ok(action.initialConfig == a.initialConfig,
+ "fromControl sets the passed action's initial config in the " +
+ "instance's initial config");
+ }
+ </script>
+ <body>
+ <div id="mappanel"></div>
+ </body>
+</html>
Modified: sandbox/elemoine/playground/geoext/tests/list-tests.html
===================================================================
--- sandbox/elemoine/playground/geoext/tests/list-tests.html 2009-05-15 13:23:53 UTC (rev 758)
+++ sandbox/elemoine/playground/geoext/tests/list-tests.html 2009-05-15 13:25:05 UTC (rev 759)
@@ -8,6 +8,7 @@
<li>lib/GeoExt/data/ScaleStore.html</li>
<li>lib/GeoExt/data/ProtocolProxy.html</li>
<li>lib/GeoExt/data/WMSCapabilitiesReader.html</li>
+ <li>lib/GeoExt/widgets/Action.html</li>
<li>lib/GeoExt/widgets/MapPanel.html</li>
<li>lib/GeoExt/widgets/Popup.html</li>
<li>lib/GeoExt/widgets/form/SearchAction.html</li>
More information about the Commits
mailing list