+
+ // show_record();
+ it("found Termlist", function () {
+ var termlist = $("div#mkwsTermlists");
+ debug("Termlist success: " + termlist.length);
+ expect(termlist.length == 1).toBe(true);
+
+ var sources = $("div#mkwsFacetSources");
+ expect(sources.length == 1).toBe(true);
+
+ var subjects = $("div#mkwsFacetSubjects");
+ expect(subjects.length == 1).toBe(true);
+
+ var authors = $("div#mkwsFacetAuthors");
+ expect(authors.length == 1).toBe(true);
+ });
+
+ // show_record();
+ it("Limit search to first source", function () {
+ var hits_all_targets = get_hit_counter();
+
+ var click = $("div#mkwsFacetSources div.term:nth-child(2) a").trigger("click");
+ debug("limit source click is success: " + click.length);
+ expect(click.length == 1).toBe(true);
+
+ waitsFor(function () {
+ if ($("div#mkwsNavi").length && $("div#mkwsNavi").text().match(/^Source/)) {
+ return true;
+ } else {
+ return false;
+ }
+ }, "Search for source in navi bar", 1000);
+
+ waitsFor(function () {
+ return get_hit_counter() < hits_all_targets ? true : false;
+ }, "Search for with less hits", 9 * 1000);
+
+ runs(function () {
+ var hits_single_target = get_hit_counter();
+ debug("get less hits for sources: " + hits_all_targets + " > " + hits_single_target);
+ expect(hits_all_targets).toBeGreaterThan(hits_single_target);
+ });
+ });
+
+ // show_record();
+ it("Limit search to first author", function () {
+ var hits_all_targets = get_hit_counter();
+
+ var click = $("div#mkwsFacetAuthors div.term:nth-child(2) a").trigger("click");
+ debug("limit author click is success: " + click.length);
+ expect(click.length == 1).toBe(true);
+
+ waitsFor(function () {
+ return get_hit_counter() < hits_all_targets ? true : false;
+ }, "Search for with less hits", 9 * 1000);
+
+ runs(function () {
+ var hits_single_target = get_hit_counter();
+ debug("get less hits for authors: " + hits_all_targets + " > " + hits_single_target);
+ expect(hits_all_targets).toBeGreaterThan(hits_single_target);
+ });
+ });
+
+ // show_record();