+ var clients = mkws.$("div.mkwsStat span.mkwsClientCount");
+ debug("span.mkwsClientCount: " + 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.mkwsRemovable").eq(0).trigger("click");
+ debug("Removed first facets link: " + click.length);
+ expect(click.length).toBe(1);
+ });
+
+ runs(function () {
+ $(".mkwsPager").bind("DOMNodeInserted DOMNodeRemoved propertychange", function () {
+ waitcount++;
+ debug("DOM change for removeable: " + waitcount);
+ });
+ });
+
+ 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);
+
+
+ runs(function () {
+ debug("unbind removable");
+ $(".mkwsPager").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.mkwsPerpage option[selected='selected']");
+ debug("per page default is: " + select.text() + " and unselect it");
+ select.removeAttr('selected');
+
+ select = $("select.mkwsPerpage option[value='" + per_page_number + "']").attr('selected', true);
+ debug("per page is set to: " + select.text());
+ select.trigger("change");
+
+ $("div.mkwsRecords").bind("DOMNodeInserted DOMNodeRemoved propertychange", function () {
+ waitcount++;
+ // debug("DOM wait for change, per page: " + waitcount);
+ });