X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fspec%2Fmkws-pazpar2.js;h=942fb5395491a7d6df029db08a6a3c3d69920158;hb=5bcd92254fa0d133fe882c9005fe239d410ba364;hp=dd617074fe8310321d017e7ee5d079b9010a360a;hpb=5b2497081abd0c428aae974d3828b1ab740381fe;p=mkws-moved-to-github.git diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index dd61707..942fb53 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -4,7 +4,8 @@ * */ -var debug = mkws.debug; +var debug_level = mkws.debug_level; +var debug = mkws.debug_function; var get_hit_counter = function () { // not yet here @@ -57,6 +58,11 @@ describe("Check pazpar2 search", function () { }); +/* + * This part runs in background. It should be rewritten with + * async jasmine functions + * + */ describe("Check pazpar2 navigation", function () { // Asynchronous part it("check running search next/prev", function () { @@ -67,7 +73,7 @@ describe("Check pazpar2 navigation", function () { debug("trigger click on id: " + id); var click = $(id).trigger("click"); - debug("next click is success: " + click.length); + debug("next/prev: " + id + " click is success: " + click.length); expect(click.length).toBe(1); }, time * 1000); } @@ -124,6 +130,8 @@ describe("Check Termlist", function () { return $("div#mkwsFacetSources").length == 1 ? true : false; }, "check for facet sources", 2 * 1000); + + // everything displayed? runs(function () { var sources = $("div#mkwsFacetSources"); debug("Termlist sources success: " + sources.length); @@ -136,6 +144,13 @@ describe("Check Termlist", function () { expect(authors.length).toBe(1); }); + waitsFor(function () { + return $("div#mkwsFacetAuthors div.term").length >= 2 ? true : false; + }, "At least one author link displayed", 2 * 1000); + + runs(function () { + expect($("div#mkwsFacetAuthors div.term").length).toBeGreaterThan(1); + }); }); it("limit search to first author", function () {