refactor "Show record"
[mkws-moved-to-github.git] / test / spec / mkws-pazpar2.js
index 9a5746f..7313287 100644 (file)
@@ -114,13 +114,6 @@ describe("Check pazpar2 hit counter", function () {
 });
 
 describe("Check Termlist", function () {
-    function show_record() {
-        var click = $("div#mkwsRecords div.record:nth-child(3) :nth-child(2)").trigger("click");
-        debug("show click is success: " + click.length);
-        expect(click.length == 1).toBe(true);
-    }
-
-    // show_record();
     it("found Termlist", function () {
         var termlist = $("div#mkwsTermlists");
         debug("Termlist success: " + termlist.length);
@@ -179,38 +172,14 @@ describe("Check Termlist", function () {
             expect(hits_all_targets).toBeGreaterThan(hits_single_target);
         });
     });
-
-    it("show record author", function () {
-        show_record();
-    });
 });
 
-describe("Check status client counter", function () {
-    function get_time() {
-        var date = new Date();
-        return date.getTime();
-    }
-    var time = get_time();
-
-    it("check status clients", function () {
-
-        waitsFor(function () {
-            var clients = $("div#mkwsStat span.clients");
-            if (clients.length == 1 && clients.text() == "0/1") {
-                return true;
-            } else {
-                return false;
-            }
-
-        }, "wait for status", 4 * 1000);
-
-    });
-    runs(function () {
-        var clients = $("div#mkwsStat span.clients");
-        debug("span.clients: " + clients.text());
-        expect(clients.text()).toEqual("0/1");
+describe("Show record", function () {
+    it("show record author", function () {
+        var click = $("div#mkwsRecords div.record:nth-child(3) :nth-child(2)").trigger("click");
+        debug("show click is success: " + click.length);
+        expect(click.length == 1).toBe(true);
     });
-
 });
 
 describe("Check switch menu Records/Targets", function () {
@@ -252,6 +221,34 @@ describe("Check switch menu Records/Targets", function () {
     });
 });
 
+describe("Check status client counter", function () {
+    function get_time() {
+        var date = new Date();
+        return date.getTime();
+    }
+    var time = get_time();
+
+    it("check status clients", function () {
+
+        waitsFor(function () {
+            var clients = $("div#mkwsStat span.clients");
+            if (clients.length == 1 && clients.text() == "0/1") {
+                return true;
+            } else {
+                return false;
+            }
+
+        }, "wait for status", 4 * 1000);
+
+    });
+    runs(function () {
+        var clients = $("div#mkwsStat span.clients");
+        debug("span.clients: " + clients.text());
+        expect(clients.text()).toEqual("0/1");
+    });
+
+});
+
 /* dummy EOF */
 describe("All tests are done", function () {
     it(">>> hooray <<<", function () {});