+ var clients = $("div.mkws-stat span.mkws-client-count");
+ debug("span.mkws-client-count: " + clients.text());
+ expect(clients.text()).toMatch("0/1$");
+ });
+ });
+});
+
+/* remove the "source" and "author" facet link to get more records again */
+describe("Check removable facets links", function () {
+ var $ = mkws.$;
+
+ it("remove links for source and author", function () {
+ var waitcount = 0;
+ if (!jasmine_config.check_sortby) {
+ debug("ignore check for removable facets");
+ return;
+ }
+
+
+ runs(function () {
+ var click = $("a.mkws-removable").eq(0).trigger("click");
+ debug("Removed first facets link: " + click.length);
+ expect(click.length).toBe(1);
+ });
+
+ runs(function () {
+ $("div.mkws-records").bind("DOMNodeInserted DOMNodeRemoved propertychange", function () {
+ waitcount++;
+ debug("DOM change mkws-records for removeable: " + waitcount);
+ });
+ });
+
+ waitsFor(function () {
+ return waitcount >= 2 && $("a.mkws-removable").length == 1 ? 1 : 0;
+ }, "Records DOM change mkws-records, removable", 2 * jasmine_config.second);
+
+ runs(function () {
+ debug("unbind removable");
+ $("div.mkws-records").unbind("DOMNodeInserted DOMNodeRemoved propertychange");
+ waitcount = 0;
+
+ $("div.mkws-records").bind("DOMNodeInserted DOMNodeRemoved propertychange", function () {
+ waitcount++;
+ debug("DOM change mkws-records for removeable2: " + waitcount);
+ });
+
+ var click = $("a.mkws-removable").eq(0).trigger("click");
+ debug("Removed second facets link: " + click.length);
+ expect(click.length).toBe(1);
+ });
+
+ waitsFor(function () {
+ return waitcount >= 2 && $("a.mkws-removable").length == 0 ? true : false;
+ }, "DOM change mkws-records, removable2", 2 * jasmine_config.second);
+
+ runs(function () {
+ debug("unbind removable2");
+ $("div.mkws-records").unbind("DOMNodeInserted DOMNodeRemoved propertychange");
+ });
+ });
+});
+
+
+describe("Check per page options", function () {
+ var $ = mkws.$;
+
+ it("show per page", function () {
+ if (!jasmine_config.check_sortby) {
+ debug("ignore check for per page select");
+ return;
+ }
+ var waitcount = 0;
+ var per_page_number = 20;
+
+
+ runs(function () {
+ var select = $("select.mkws-perpage option[selected='selected']");
+ debug("per page default is: " + select.text() + " and unselect it");
+ select.removeAttr('selected');
+
+ select = $("select.mkws-perpage option[value='" + per_page_number + "']").attr('selected', true);
+ debug("per page is set to: " + select.text());
+ select.trigger("change");
+
+ $("div.mkws-records").bind("DOMNodeInserted DOMNodeRemoved propertychange", function () {
+ waitcount++;
+ debug("DOM change mkws-records, per page: " + waitcount);
+ });