Author: jmorliaguet
Date: Mon Jan 30 21:18:00 2006
New Revision: 2254

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
   cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_test.html
Log:

- more tests / fixes



Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Mon Jan 30 
21:18:00 2006
@@ -581,7 +581,7 @@
 
   // TODO: to rewrite: this might not work if called asynchronously.
   updateData: function(data) {
-    Object.extend(data, this.data || new Object());
+    Object.extend(data, this.def.data || new Object());
     this.setData(data);
   },
 

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_test.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_test.html   
    (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_test.html   
    Mon Jan 30 21:18:00 2006
@@ -236,6 +236,32 @@
 
     /* Canvas */
 
+    testCreateNode: function() { with(this) {
+      var n1 = Canvas.createNode({
+        tag: "div",
+      });
+      assertEqual(n1.tagName.toLowerCase(), "div");
+
+      var n2 = Canvas.createNode({
+        tag: "a",
+        attributes: {
+          "href": "someurl.html"
+        }
+      });
+      assertEqual(n2.tagName.toLowerCase(), "a");
+      assertEqual(n2.getAttribute("href"), "someurl.html");
+
+      var n3 = Canvas.createNode({
+        tag: "span",
+        classes: "cssClass",
+        style: {position: "absolute", display: "none"},
+      });
+      assertEqual(n3.tagName.toLowerCase(), "span");
+      assertEqual(n3.style.position, "absolute");
+      assertEqual(n3.style.display, "none");
+      assert(Element.hasClassName(n3, "cssClass"));
+    }},
+
     testGetModelNode: function() { with(this) {
       assertEqual(Canvas._getModelNode(e0), null);
       assertEqual(Canvas._getModelNode(e1), null);
@@ -243,7 +269,7 @@
       assertEqual(Canvas._getModelNode(e3), null);
       assertEqual(Canvas._getModelNode(e4), null);
       assertEqual(Canvas._getModelNode(e5), null);
-      assertEqual(Canvas._getModelNode(e6), null);
+      assertNotEqual(Canvas._getModelNode(e6), null);
     }},
 
     testGetModel: function() { with(this) {
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to