remove facets links one after each other, not a the same time
[mkws-moved-to-github.git] / 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);