+
+describe("Check switch menu Records/Targets", function () {
+ it("check mkwsSwitch", function () {
+ expect($("div#mkwsSwitch").length).toBe(1);
+
+ // expect 2 clickable links
+ expect($("div#mkwsSwitch a").length).toBe(2);
+ });
+
+ it("switch to target view", function () {
+ var click = $("a#mkwsSwitch_targets").trigger("click");
+ debug("target click is success: " + click.length);
+ expect(click.length == 1).toBe(true);
+
+ // now the target table must be visible
+ expect($("div#mkwsBytarget").is(":visible")).toBe(true);
+ expect($("div#mkwsResults").is(":visible")).toBe(false);
+
+ // wait a half second, to show the target view
+ var time = (new Date).getTime();
+ waitsFor(function () {
+ return (new Date).getTime() - time > 700 ? true : false;
+ }, "wait some miliseconds", 1 * 1000);
+ // look for table header
+ runs(function () {
+ expect($("div#mkwsBytarget").html()).toMatch(/Target ID/);
+ });
+ });
+
+ it("switch back to record view", function () {
+ var click = $("a#mkwsSwitch_records").trigger("click");
+ debug("record click is success: " + click.length);
+ expect(click.length == 1).toBe(true);
+
+ // now the target table must be visible
+ expect($("div#mkwsBytarget").is(":visible")).toBe(false);
+ expect($("div#mkwsResults").is(":visible")).toBe(true);
+ });
+});
+
+/* dummy EOF */
+describe("All tests are done", function () {
+ it(">>> hooray <<<", function () {});
+});