remove facets links one after each other, not a the same time
authorWolfram Schneider <wosch@indexdata.dk>
Mon, 7 Jul 2014 11:23:27 +0000 (11:23 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Mon, 7 Jul 2014 11:23:27 +0000 (11:23 +0000)
Sometimes the facets links disappears, but the new search results
does not appears. But it is very unlikely that a user clicks
both links a the same time, so don't do that in a jasmine test.

test/spec/mkws-pazpar2.js

index 08ea2e6..44fb4a3 100644 (file)
@@ -532,9 +532,9 @@ describe("Check removable facets links", function () {
         var waitcount = 0;
 
         runs(function () {
-            var click = $("a.mkwsRemovable").trigger("click");
-            debug("Removed facets links: " + click.length);
-            expect(click.length).toBe(2);
+            var click = $("a.mkwsRemovable").eq(0).trigger("click");
+            debug("Removed first facets link: " + click.length);
+            expect(click.length).toBe(1);
         });
 
         runs(function () {
@@ -545,6 +545,16 @@ describe("Check removable facets links", function () {
         });
 
         waitsFor(function () {
+            return $("a.mkwsRemovable").length == 1 ? 1 : 0;
+        });
+
+        runs(function () {
+            var click = $("a.mkwsRemovable").eq(0).trigger("click");
+            debug("Removed second facets link: " + click.length);
+            expect(click.length).toBe(1);
+        });
+
+        waitsFor(function () {
             // debug("wait for: " + waitcount);
             return waitcount >= 2 ? true : false;
         }, "Records DOM change, by per page", 2 * jasmine_config.second);