From: Wolfram Schneider Date: Mon, 10 Mar 2014 14:23:13 +0000 (+0000) Subject: Check for DOMSubtreeModified and a first link X-Git-Tag: 1.0.0~1318^2~11 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=8d2e36a0a3df10e829a647d7488c609837049876;p=mkws-moved-to-github.git Check for DOMSubtreeModified and a first link some browser sents 2 DOMSubtreeModified events, other only one. Make sure it will works for both, and check for the first link too. --- diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index 7e180c3..9503683 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -321,6 +321,7 @@ describe("Check Termlist", function () { describe("Check record list", function () { it("got a record", function () { + var linkaddr = "div.mkwsRecords div.record:nth-child(1) a"; var waitcount = 0; // wait for new records @@ -330,14 +331,13 @@ describe("Check record list", function () { }); waitsFor(function () { - return waitcount; - }, "wait until we see a record", 1.5 * jasmine_config.second); + return waitcount > 0 && $(linkaddr).length > 0; + }, "wait until we see a new record", 2.2 * jasmine_config.second); runs(function () { expect(waitcount).toBeGreaterThan(0); $("div.mkwsRecords").unbind("DOMSubtreeModified"); }); - }); });