rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpie...@apache.org
Subject svn commit: r1102354 - /incubator/rave/trunk/rave-portal/src/test/javascript/raveWookieSpec.js
Date Thu, 12 May 2011 15:38:42 GMT
Author: mpierce
Date: Thu May 12 15:38:42 2011
New Revision: 1102354

URL: http://svn.apache.org/viewvc?rev=1102354&view=rev
Log:
Adding an initial set of Jasmine tests for rave_wookie.  My knowledge of Jasmine is pretty
limited so I haven't yet found a way to handle initWidget's call to document.getElementById.


Added:
    incubator/rave/trunk/rave-portal/src/test/javascript/raveWookieSpec.js

Added: incubator/rave/trunk/rave-portal/src/test/javascript/raveWookieSpec.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/test/javascript/raveWookieSpec.js?rev=1102354&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal/src/test/javascript/raveWookieSpec.js (added)
+++ incubator/rave/trunk/rave-portal/src/test/javascript/raveWookieSpec.js Thu May 12 15:38:42
2011
@@ -0,0 +1,48 @@
+describe("Rave Wookie", function() {
+
+     it("Is W3C Widget", function() {
+        expect(rave.wookie.TYPE).toEqual("W3C");
+     });
+
+     describe("Verify null widgets results in clean return", function() {
+	     it("Tests null argument", function() {
+           var wookieMap=rave.wookie.initWidgets(null);
+			  //Lifted from raveSpec.js.  Must be other ways to test this.
+			  var count=0;
+           for (i in wookieMap) {count++;}
+           expect(count).toEqual(0);
+        });
+
+	     it("Tests uncreated list", function() {
+           var widgets;		     
+           var wookieMap=rave.wookie.initWidgets(widgets);
+			  //Lifted from raveSpec.js.  Must be other ways to test this.
+			  var count=0;
+           for (i in wookieMap) {count++;}
+           expect(count).toEqual(0);
+        });
+
+	     it("Tests empty list", function() {
+           var widgets=[];		     
+           var wookieMap=rave.wookie.initWidgets(widgets);
+			  //Lifted from raveSpec.js.  Must be other ways to test this.
+			  var count=0;
+           for (i in wookieMap) {count++;}
+           expect(count).toEqual(0);
+        });
+     });
+
+     describe("Create Wookie Widgets",function() {
+        //This test is currently incomplete because we need to find
+        //a way to handle the document.getElementID() call within rave_wookie.js
+	     it("initializes wookie widgets", function() {
+            var widgets = [
+                {regionWidgetId: 0, type: "W3C"},
+                {regionWidgetId: 1, type: "null"},
+                {regionWidgetId: 2}
+            ];
+			  var wookieMap=rave.wookie.initWidgets(widgets[rave.wookie.TYPE]);
+        });
+     });
+
+});
\ No newline at end of file



Mime
View raw message