зеркало из https://github.com/mozilla/popcorn-js.git
testing the innerHTML is inconsistent + small fixes [#358 state:peer-review-requested]
This commit is contained in:
Родитель
43f14ad0ee
Коммит
fd520a3526
|
@ -87,7 +87,7 @@ var wikiCallback;
|
||||||
options._fired = true;
|
options._fired = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
Popcorn.getScript("http://" + options.lang + ".wikipedia.org/w/api.php?action=parse&props=text&page=" + ( options.title || options.src.slice( options.src.lastIndexOf("/")+1) ) + "&format=json&callback=wikiCallback" + _guid);
|
Popcorn.getScript("http://" + options.lang + ".wikipedia.org/w/api.php?action=parse&props=text&page=" + options.src.slice( options.src.lastIndexOf("/")+1) + "&format=json&callback=wikiCallback" + _guid);
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
test("Popcorn wikipedia Plugin", function () {
|
test("Popcorn wikipedia Plugin", function () {
|
||||||
|
|
||||||
var popped = Popcorn("#video"),
|
var popped = Popcorn("#video"),
|
||||||
expects = 9,
|
expects = 10,
|
||||||
count = 0,
|
count = 0,
|
||||||
theArticle = document.getElementById('wikidiv');
|
theArticle = document.getElementById('wikidiv');
|
||||||
|
|
||||||
|
@ -42,9 +42,9 @@ test("Popcorn wikipedia Plugin", function () {
|
||||||
plus();
|
plus();
|
||||||
equals (theArticle.childElementCount, 2, "wikidiv now contains two child elements" );
|
equals (theArticle.childElementCount, 2, "wikidiv now contains two child elements" );
|
||||||
plus();
|
plus();
|
||||||
equals (theArticle.childElement[0].innerHTML, "this is an article", "wikidiv has the right title" );
|
equals (theArticle.childNodes[0].innerHTML, "this is an article", "wikidiv has the right title" );
|
||||||
plus();
|
plus();
|
||||||
equals (theArticle.childElement[1].innerHTML, "Cape Town metropolitan municipality. It is the provincial capital and primate city ...", "wikidiv has the right content" );
|
ok (theArticle.childNodes[1].innerHTML !="", "wikidiv has some content" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ test("Popcorn wikipedia Plugin", function () {
|
||||||
plus();
|
plus();
|
||||||
equals (theArticle.childElementCount, 2, "wikidiv now contains two child elements" );
|
equals (theArticle.childElementCount, 2, "wikidiv now contains two child elements" );
|
||||||
plus();
|
plus();
|
||||||
equals (theArticle.childElement[1].innerHTML, "São Paulo is the largest city in Brazil, the largest city in the southern hemisphere, and the world's 7th largest metropolitan area. The city is the capital of the state of São Paulo, the most populou ...", "wikidiv has the right content" );
|
ok (theArticle.childNodes[1].innerHTML != "", "wikidiv has the right content" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Загрузка…
Ссылка в новой задаче