Merge branch 'master' of ssh://git.indexdata.com:222/home/git/private/mkws
authorWolfram Schneider <wosch@indexdata.dk>
Tue, 24 Sep 2013 11:26:22 +0000 (11:26 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Tue, 24 Sep 2013 11:26:22 +0000 (11:26 +0000)
test/spec/mkws-pazpar2.js
tools/htdocs/mkws.js

index dd61707..643b415 100644 (file)
@@ -57,6 +57,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 +72,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 +129,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 +143,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 () {
index 0414414..51de2f9 100644 (file)
@@ -391,7 +391,7 @@ function drawPager (pagerDiv)
 
     var prev = '<span id="mkwsPrev">&#60;&#60; ' + M('Prev') + '</span><b> | </b>';
     if (curPage > 1)
-        prev = '<a href="#" id="mkwsPrev" onclick="pagerPrev();">'
+        prev = '<a href="#" id="mkwsPrev" onclick="mkws.pagerPrev();">'
         +'&#60;&#60; ' + M('Prev') + '</a><b> | </b>';
 
     var middle = '';
@@ -436,7 +436,7 @@ mkws.pagerNext = function () {
     }
 }
 
-function pagerPrev() {
+mkws.pagerPrev = function () {
     if ( my_paz.showPrev() != false )
         curPage--;
 }