});
});
+describe("Check translations", function () {
+ var $ = mkws.$;
+
+ // handle html entities, "Zurück" => "Zurück"
+ var M = function (string) {
+ var text = $("<span/>").html(mkws.M(string)).text()
+ debug("translate check for: " + text);
+ return text;
+ };
+ var lang = function () {
+ return mkws.config.lang
+ };
+
+ function check_translation(list, text) {
+ expect(list.length).toBe(text.length);
+
+ for (var i = 0; i < text.length; i++) {
+ expect($(list[i]).text()).toBe(M(text[i]));
+ }
+ }
+
+ it("check language", function () {
+ var lang = mkws.config.lang;
+ debug("lang: " + lang);
+ expect(lang).toMatch(/^(de|da|)$/);
+ });
+
+/*
+ locale_lang: {
+ "de": {
+ "Authors": "Autoren",
+ "Subjects": "Schlagwörter",
+ "Sources": "Daten und Quellen",
+ "source": "datenquelle",
+ "Facets": "Termlisten",
+ "Next": "Weiter",
+ "Prev": "Zurück",
+ "Search": "Suche",
+ "Sort by": "Sortieren nach",
+ "and show": "und zeige",
+ "per page": "pro Seite",
+ "Displaying": "Zeige",
+ "to": "von",
+ "of": "aus",
+ "found": "gefunden",
+ "Title": "Titel",
+ "Author": "Autor",
+ "author": "autor",
+ "Date": "Datum",
+ "Subject": "Schlagwort",
+ "subject": "schlagwort",
+ "Location": "Ort",
+ "Records": "Datensätze",
+ "Targets": "Datenbanken",
+
+ "dummy": "dummy"
+ },
+*/
+
+ it("search button", function () {
+ var list = $(".mkws-pager-desc > span");
+ expect($("form > input[type=submit]").attr("value")).toBe(M("Search"));
+ });
+
+ it("switch", function () {
+ var list = $(".mkws-switch > a")
+ var text = ["Records", "Targets"];
+
+ check_translation(list, text);
+ });
+
+
+ it("ranking form", function () {
+ var list = $(".mkws-ranking > form > span");
+ var text = ["Sort by", "and show", "per page"];
+
+ check_translation(list, text);
+
+ // double check
+ if (lang == "de") {
+ expect("Sortieren nach").toBe(M("Sort by"));
+ expect("Sortieren nach").toBe($(list[0]).text());
+ } else if (lang == "da") {
+ expect("Sorter efter").toBe(M("Sort by"));
+ expect("Sorter efter").toBe($(list[0]).text());
+ }
+ });
+
+ xit("facets sidebar", function () {
+ var list = $(".mkws-facet-title");
+ var text = ["Sources", "Subjects", "Authors"];
+
+ check_translation(list, text);
+ });
+
+ it("facets navigation/filter", function () {
+ var list = $(".mkws-navi > span");
+ var text = ["source", "author"];
+
+ check_translation(list, text);
+ });
+
+ it("navigation", function () {
+ var list = $(".mkws-pager-desc > span");
+ var text = ["Displaying", "to", "of", "found"];
+
+ check_translation(list, text);
+
+ expect($(".mkws-next").text()).toBe(M("Next"));
+ expect($(".mkws-prev").text()).toBe(M("Prev"));
+ });
+
+ it("record details", function () {
+ var text = ["Title", "Date", "Author"]; // , "Subject", "Locations"];
+ var list = $("div.mkws-details table > tbody > tr > th");
+
+ // compare only the first 3 elements
+ list = list.splice(0, text.length)
+
+ check_translation(list, text);
+ });
+});
+
describe("Check status client counter", function () {
var $ = mkws.$;
});
});
-describe("Check translations", function () {
- var $ = mkws.$;
-
- // handle html entities, "Zurück" => "Zurück"
- var M = function (string) {
- var text = $("<span/>").html(mkws.M(string)).text()
- debug("translate check for: " + text);
- return text;
- };
- var lang = function () {
- return mkws.config.lang
- };
-
- function check_translation(list, text) {
- expect(list.length).toBe(text.length);
-
- for (var i = 0; i < text.length; i++) {
- expect($(list[i]).text()).toBe(M(text[i]));
- }
- }
-
- it("check language", function () {
- var lang = mkws.config.lang;
- debug("lang: " + lang);
- expect(lang).toMatch(/^(de|da|)$/);
- });
-
-/*
- locale_lang: {
- "de": {
- "Authors": "Autoren",
- "Subjects": "Schlagwörter",
- "Sources": "Daten und Quellen",
- "source": "datenquelle",
- "Facets": "Termlisten",
- "Next": "Weiter",
- "Prev": "Zurück",
- "Search": "Suche",
- "Sort by": "Sortieren nach",
- "and show": "und zeige",
- "per page": "pro Seite",
- "Displaying": "Zeige",
- "to": "von",
- "of": "aus",
- "found": "gefunden",
- "Title": "Titel",
- "Author": "Autor",
- "author": "autor",
- "Date": "Datum",
- "Subject": "Schlagwort",
- "subject": "schlagwort",
- "Location": "Ort",
- "Records": "Datensätze",
- "Targets": "Datenbanken",
-
- "dummy": "dummy"
- },
-*/
-
- it("search button", function () {
- var list = $(".mkws-pager-desc > span");
- expect($("form > input[type=submit]").attr("value")).toBe(M("Search"));
- });
-
- it("switch", function () {
- var list = $(".mkws-switch > a")
- var text = ["Records", "Targets"];
-
- check_translation(list, text);
- });
-
-
- it("ranking form", function () {
- var list = $(".mkws-ranking > form > span");
- var text = ["Sort by", "and show", "per page"];
-
- check_translation(list, text);
-
- // double check
- if (lang == "de") {
- expect("Sortieren nach").toBe(M("Sort by"));
- expect("Sortieren nach").toBe($(list[0]).text());
- } else if (lang == "da") {
- expect("Sorter efter").toBe(M("Sort by"));
- expect("Sorter efter").toBe($(list[0]).text());
- }
- });
-
- xit("facets sidebar", function () {
- var list = $(".mkws-facet-title");
- var text = ["Sources", "Subjects", "Authors"];
-
- check_translation(list, text);
- });
-
- it("facets navigation/filter", function () {
- var list = $(".mkws-navi > span");
- var text = ["source", "author"];
-
- check_translation(list, text);
- });
-
- it("navigation", function () {
- var list = $(".mkws-pager-desc > span");
- var text = ["Displaying", "to", "of", "found"];
-
- check_translation(list, text);
-
- expect($(".mkws-next").text()).toBe(M("Next"));
- expect($(".mkws-prev").text()).toBe(M("Prev"));
- });
-
- it("record details", function () {
- var text = ["Title", "Date", "Author"]; // , "Subject", "Locations"];
- var list = $("div.mkws-details table > tbody > tr > th");
-
- // compare only the first 3 elements
- list = list.splice(0, text.length)
-
- check_translation(list, text);
- });
-});
xdescribe("Check async widget discovery", function () {
var $ = mkws.$;