[Commits] r2698 - sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/tests/lib/GeoExt.ux/widgets

commits at geoext.org commits at geoext.org
Mon May 16 21:45:56 CEST 2011


Author: adube
Date: 2011-05-16 21:45:56 +0200 (Mon, 16 May 2011)
New Revision: 2698

Modified:
   sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/tests/lib/GeoExt.ux/widgets/WFSTFeatureEditingManager.html
Log:
WFSTFeatureEditing - manager event test units

Modified: sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/tests/lib/GeoExt.ux/widgets/WFSTFeatureEditingManager.html
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/tests/lib/GeoExt.ux/widgets/WFSTFeatureEditingManager.html	2011-05-16 19:02:13 UTC (rev 2697)
+++ sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/tests/lib/GeoExt.ux/widgets/WFSTFeatureEditingManager.html	2011-05-16 19:45:56 UTC (rev 2698)
@@ -43,7 +43,7 @@
         return new Ext.Toolbar();
     };
 
-    function test_WFSTFeatureEditingStatusBar_constructor(t) {
+    function test_WFSTFeatureEditingManager_constructor(t) {
         t.plan(21);
         
         var manager, log = [];
@@ -121,6 +121,47 @@
         t.eq(log[0], "http://localhost/mywfsserver?",
             "createToolsFromURL called with correct url");
     }
+
+    function test_WFSTFeatureEditingManager_events(t) {
+        t.plan(3);
+
+        var manager, log, callback;
+        GeoExt.ux.WFSTFeatureEditingManager.prototype.createToolsFromURL = function() {};
+
+        manager = new GeoExt.ux.WFSTFeatureEditingManager({
+            "map": getNewMap(),
+            "toolbar": getNewToolbar(),
+            "mainPanelContainer": getNewMainPanelContainer(),
+            "url": "http://localhost/mywfsserver?"
+        });
+
+        var callback = function() {
+            log = true;
+        };
+
+        // (3) testing events
+        log = false;
+        manager.on("commitstart", callback);
+        manager.fireEvent("commitstart");
+        t.ok(log, "commistart event fired, callback method called");
+        manager.un("commitstart", callback);
+
+        log = false;
+        manager.on("commitsuccess", callback);
+        manager.fireEvent("commitsuccess");
+        t.ok(log, "commitsuccess event fired, callback method called");
+        manager.un("commitsuccess", callback);
+
+        log = false;
+        manager.on("commitfail", callback);
+        manager.fireEvent("commitfail");
+        t.ok(log, "commitfail event fired, callback method called");
+        manager.un("commitfail", callback);
+    }
+
+    function test_WFSTFeatureEditingManager_WFSCapabilitiesStore(t) {
+        t.plan(0);
+    }
     </script>
   <body>
     <div id="map"></div>



More information about the Commits mailing list