From a5b41e83a9473f909dd6c0ceda29f2d1ff3a23fb Mon Sep 17 00:00:00 2001 From: Anna Sobiepanek Date: Mon, 31 Jan 2011 14:11:24 -0500 Subject: [PATCH] added unit test [#294] --- .../popcorn.tagthisperson.unit.js | 9 ++++++--- test/data/parseMissing.json | 20 +++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/plugins/tagthisperson/popcorn.tagthisperson.unit.js b/plugins/tagthisperson/popcorn.tagthisperson.unit.js index 6c3894a2..55895c9b 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 fa7d212b..21d124c3 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 + } + } + ] +}