From dc3e44937524489d7bc97cbbe291e861dfc0a63c Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Wed, 9 Jul 2014 11:35:04 +0000 Subject: [PATCH] reset DOM change counter for second un-facet link, part of MKWS-241 --- test/spec/mkws-pazpar2.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index b353443..34b2804 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -585,19 +585,26 @@ describe("Check removable facets links", function () { }, "Records DOM change mkwsRecords, removable", 2 * jasmine_config.second); runs(function () { + debug("unbind removable"); + $("div.mkwsRecords").unbind("DOMNodeInserted DOMNodeRemoved propertychange"); + waitcount = 0; + + $("div.mkwsRecords").bind("DOMNodeInserted DOMNodeRemoved propertychange", function () { + waitcount++; + debug("DOM change mkwsRecords for removeable2: " + waitcount); + }); + 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 >= 4 && $("a.mkwsRemovable").length == 0 ? true : false; + return waitcount >= 2 && $("a.mkwsRemovable").length == 0 ? true : false; }, "DOM change mkwsRecords, removable2", 2 * jasmine_config.second); - runs(function () { - debug("unbind removable"); + debug("unbind removable2"); $("div.mkwsRecords").unbind("DOMNodeInserted DOMNodeRemoved propertychange"); }); }); -- 1.7.10.4