зеркало из https://github.com/mozilla/popcorn-js.git
added unit test [#294]
This commit is contained in:
Родитель
dc61cc88e3
Коммит
a5b41e83a9
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"data": [
|
||||
{
|
||||
"parserMissing": {
|
||||
"start": 5,
|
||||
"end": 6
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"parserMissing": {
|
||||
"start": 5,
|
||||
"end": 6
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче