From 12182f2acfc86aa454cc9f0f29b89e05ff0c4f34 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Mon, 7 Jul 2014 11:23:27 +0000 Subject: [PATCH] remove facets links one after each other, not a the same time 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 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index 08ea2e6..44fb4a3 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -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); -- 1.7.10.4