+ waitsFor(function () {
+ return $("div#mkwsFacetSources").length == 1 ? true : false;
+ }, "check for facet sources", 2 * 1000);
+
+
+ // everything displayed?
+ runs(function () {
+ var sources = $("div#mkwsFacetSources");
+ debug("Termlist sources success: " + sources.length);
+ expect(sources.length).toBe(1);
+
+ var subjects = $("div#mkwsFacetSubjects");
+ expect(subjects.length).toBe(1);
+
+ var authors = $("div#mkwsFacetAuthors");
+ expect(authors.length).toBe(1);
+ });
+
+ waitsFor(function () {
+ return $("div#mkwsFacetAuthors div.term").length >= 2 ? true : false;
+ }, "At least one author link displayed", 2 * 1000);
+
+ runs(function () {
+ expect($("div#mkwsFacetAuthors div.term").length).toBeGreaterThan(1);
+ });
+ });
+
+ it("limit search to first author", function () {
+ var hits_all_targets = get_hit_counter();
+ var author_number = 2; // 2=first author
+ var author_name = $("div#mkwsFacetAuthors div.term:nth-child(" + author_number + ") a").text();
+ // do not click on author with numbers, e.g.: Bower, James M. Beeman, David, 1938-
+ if (author_name.match(/[0-9].+[0-9]/)) {
+ author_number++;