From: Wolfram Schneider Date: Fri, 24 Jan 2014 14:15:20 +0000 (+0000) Subject: use the more portable $(obj).text() instead obj.text, MKWS-77 X-Git-Tag: 1.0.0~1607^2~2 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=b5c1d1eb4a29e9fba366ac253c02f27e6f6d8142;p=mkws-moved-to-github.git use the more portable $(obj).text() instead obj.text, MKWS-77 jquery xpath match returns a list of HTML object, so we need to convert the object back to jquery, and run the .text() method on it instead .text property --- diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index e52e0f8..657b5dd 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -212,7 +212,7 @@ describe("Check Termlist", function () { // do not click on author names without a comma, e.g.: "Joe Barbara" var terms = $("div#mkwsFacetAuthors div.term a"); for (var i = 0; i < terms.length; i++) { - var term = terms[i].text; + var term = $(terms[i]).text(); if (term.match(/[0-9].+[0-9]/i) || !term.match(/,/)) { debug("ignore author facet: " + term); author_number++; @@ -239,11 +239,13 @@ describe("Check Termlist", function () { it("limit search to first source", function () { var hits_all_targets = get_hit_counter(); var source_number = 2; // 2=first source + // do not click on wikipedia link - no author or subject facets possible var terms = $("div#mkwsFacetSources div.term a"); for (var i = 0; i < terms.length; i++) { - if (terms[i].text.match(/wikipedia/i)) { - debug("ignore source facet: " + terms[i].text); + var term = $(terms[i]).text(); + if (term.match(/wikipedia/i)) { + debug("ignore source facet: " + term); source_number++; } else { break;