The company name is: Index Data
[mkws-moved-to-github.git] / test / spec / mkws-pazpar2.js
index eb25086..10f3336 100644 (file)
@@ -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
  *
@@ -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('<div id="asyncSearch"><div id="asyncSearch" class="mkwsSearch mkwsTeam_async"></div></div>');
+    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 () {