]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
added unit test [#294]
authorAnna Sobiepanek <annaopensource@gmail.com>
Mon, 31 Jan 2011 19:11:24 +0000 (14:11 -0500)
committerAnna Sobiepanek <annaopensource@gmail.com>
Mon, 31 Jan 2011 19:11:24 +0000 (14:11 -0500)
plugins/tagthisperson/popcorn.tagthisperson.unit.js
test/data/parseMissing.json

index 6c3894a2a54e2f45b4384f8de726672d01e9577e..55895c9b7ef00f6d16200152b79f517310721f7e 100644 (file)
@@ -1,7 +1,7 @@
 test("Popcorn tagthisperson Plugin", function () {
   
   var popped = Popcorn("#video"),
-      expects = 6, 
+      expects = 7, 
       count = 0,
       interval,
       interval2,
@@ -28,6 +28,7 @@ test("Popcorn tagthisperson Plugin", function () {
       start: 0, // seconds
       end: 5, // seconds
       person: 'Anna Sob',
+      image: 'http://newshour.s3.amazonaws.com/photos%2Fspeeches%2Fguests%2FRichardNSmith_thumbnail.jpg',
       target: 'tagdiv'
     } )
     .tagthisperson({
@@ -42,7 +43,9 @@ test("Popcorn tagthisperson Plugin", function () {
   
   interval = setInterval( function() {
     if( popped.currentTime() > 0 && popped.currentTime() <= 5 ) {
-      equals ( tagdiv.innerHTML.trim() , "Anna Sob" ,"tagdiv shows the first tag" );
+      equals (tagdiv.childElementCount, 1, "tagdiv now contains one child elements" );
+      plus();
+      equals ( tagdiv.textContent.trim() , "Anna Sob" ,"tagdiv shows the first tag" );
       plus();
       clearInterval( interval );
     }
@@ -50,7 +53,7 @@ test("Popcorn tagthisperson Plugin", function () {
   
   interval2 = setInterval( function() {
     if( popped.currentTime() > 3 && popped.currentTime() < 5  ) {
-      equals ( tagdiv.innerHTML.trim() , "Anna Sob, Scott", "tagdiv shows the first & second tag" );
+      equals ( tagdiv.textContent.trim() , "Anna Sob, Scott", "tagdiv shows the first & second tag" );
       plus();
       clearInterval( interval2 );
     }
index fa7d212b8463992f256ac1514f0ac28e30614def..21d124c3cc343e02b02a2414d7ab4ae96765f2b4 100644 (file)
@@ -1,10 +1,10 @@
-{\r
-  "data": [\r
-    {\r
-      "parserMissing": {\r
-        "start": 5,\r
-        "end": 6\r
-      }\r
-    }\r
-  ]\r
-}\r
+{
+  "data": [
+    {
+      "parserMissing": {
+        "start": 5,
+        "end": 6
+      }
+    }
+  ]
+}