From 882ab62842c8eda94634f5880d8ac834d45ad0b7 Mon Sep 17 00:00:00 2001 From: Jason Skomorowski Date: Fri, 10 Oct 2014 14:59:04 -0400 Subject: [PATCH] Fix test for async widget discovery. --- test/spec/mkws-pazpar2.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index 9a05f53..2f5b5ab 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -728,15 +728,22 @@ describe("Check SortBy options", function () { }); }); -xdescribe("Check async widget discovery", 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); + }); }); }); -- 1.7.10.4