X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fspec%2Fmkws-pazpar2.js;h=2f5b5ab9c3391fada827b554dfb23bad0d08dd53;hb=882ab62842c8eda94634f5880d8ac834d45ad0b7;hp=2e49726215d7e0a28e5de5fab380521137bc7783;hpb=2dc4cb569b76707f3ac0b23bf53d64ee5c98130b;p=mkws-moved-to-github.git diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index 2e49726..2f5b5ab 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014 IndexData ApS. http://indexdata.com +/* Copyright (c) 2013-2014 Index Data ApS. http://indexdata.com * * perform papzpar2 / pz2.js search & retrieve request in the browser * @@ -731,12 +731,19 @@ describe("Check SortBy options", function () { describe("Check async widget discovery", function () { var $ = mkws.$; it("initialises a new widget", function() { - $("div.mkwsSearch").after('
'); - mkws.init("Another search box"); - // mkws.init("Another search box", "#asyncSearch"); + $("div.mkwsSearch").after('
'); + mkws.init("Another search box", "#asyncSearch"); waitsFor(function () { return $("#asyncSearch input").length >= 1 ? true : false; }, "Call init() to build an .mkwsSearch", 750); + runs(function () { + var numInput = $("div.mkwsSearch input").length; + debug("Input elements present: " + numInput); + expect(numInput).toBe(4); + var numRec = $("div.mkwsRecords > div.mkwsSummary > a").length; + debug("Records should still be present. There are: " + numRec); + expect(numRec).toBeGreaterThan(0); + }); }); });