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.
var waitcount = 0;
runs(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);
});
waitsFor(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);
// debug("wait for: " + waitcount);
return waitcount >= 2 ? true : false;
}, "Records DOM change, by per page", 2 * jasmine_config.second);