From: Anna Sobiepanek Date: Mon, 31 Jan 2011 19:11:24 +0000 (-0500) Subject: added unit test [#294] X-Git-Tag: v0.3~1^2~3 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=a5b41e83a9473f909dd6c0ceda29f2d1ff3a23fb;p=popcorn-js.git added unit test [#294] --- diff --git a/plugins/tagthisperson/popcorn.tagthisperson.unit.js b/plugins/tagthisperson/popcorn.tagthisperson.unit.js index 6c3894a..55895c9 100644 --- a/plugins/tagthisperson/popcorn.tagthisperson.unit.js +++ b/plugins/tagthisperson/popcorn.tagthisperson.unit.js @@ -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 ); } diff --git a/test/data/parseMissing.json b/test/data/parseMissing.json index fa7d212..21d124c 100644 --- a/test/data/parseMissing.json +++ b/test/data/parseMissing.json @@ -1,10 +1,10 @@ -{ - "data": [ - { - "parserMissing": { - "start": 5, - "end": 6 - } - } - ] -} +{ + "data": [ + { + "parserMissing": { + "start": 5, + "end": 6 + } + } + ] +}