From 2dc4cb569b76707f3ac0b23bf53d64ee5c98130b Mon Sep 17 00:00:00 2001 From: Jason Skomorowski Date: Thu, 21 Aug 2014 14:15:18 -0400 Subject: [PATCH] Async init() test and example. --- examples/htdocs/async.html | 32 ++++++++++++++++++++++++++++++++ test/spec/mkws-pazpar2.js | 11 +++++++++++ 2 files changed, 43 insertions(+) create mode 100644 examples/htdocs/async.html diff --git a/examples/htdocs/async.html b/examples/htdocs/async.html new file mode 100644 index 0000000..e89cf48 --- /dev/null +++ b/examples/htdocs/async.html @@ -0,0 +1,32 @@ + + + + + + MKWS demo: Async feeling. + + + + + + + + +
+ +
+ +
+ +
This would have been four but we're not searching it.
+ + diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index eb25086..2e49726 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -728,6 +728,17 @@ 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"); + waitsFor(function () { + return $("#asyncSearch input").length >= 1 ? true : false; + }, "Call init() to build an .mkwsSearch", 750); + }); +}); /* done */ describe("All tests are done", function () { -- 1.7.10.4