X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fspec%2Fmkws-pazpar2.js;h=ceecc5ddc5de9ccac92e52eb90e94a584833d04b;hb=ce1503ff9f918a52ded3643ba8595d49c71e1277;hp=64e9815573584c11a6faa73368390282c4743728;hpb=2d4488ba838216048d65366cf984bebd5627aa8c;p=mkws-moved-to-github.git diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index 64e9815..ceecc5d 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -559,7 +559,7 @@ describe("Check switch menu Records/Targets", function () { }); // temporary disabled due records without an author, MKWS-400 -xdescribe("Check translations", function () { +describe("Check translations", function () { var $ = mkws.$; // handle html entities, "Zurück" => "Zurück" @@ -568,6 +568,7 @@ xdescribe("Check translations", function () { debug("translate check for: " + text); return text; }; + var lang = function () { return mkws.config.lang }; @@ -580,6 +581,24 @@ xdescribe("Check translations", function () { } } + function check_translation_list(list, keywords) { + var errors = []; + for (var i = 0; i < keywords.length; i++) { + var text = $(list[i]); + var keyword = keywords[i]; + + if (text.text().match("^" + M(keyword) + "")) { + debug("found: " + text.text() + " :: " + keyword); + } else { + debug("NOT found: " + text.text() + " :: " + keyword); + errors.push(keyword) + } + } + + // we except one missing field, or one error + expect(errors.length).not.toBeGreaterThan(1); + } + it("check language", function () { var lang = mkws.config.lang; debug("lang: " + lang); @@ -610,7 +629,8 @@ xdescribe("Check translations", function () { "Date": "Datum", "Subject": "Schlagwort", "subject": "schlagwort", - "Location": "Ort", + "Location": "Bestand", + "Locations": "Bestand", "Records": "Datensätze", "Targets": "Datenbanken", "relevance": "Relevanz", @@ -680,13 +700,12 @@ xdescribe("Check translations", function () { }); it("record details", function () { - var text = ["Title", "Date", "Author"]; // , "Subject", "Locations"]; + var keywords = ["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); + // list = list.splice(0, text.length) + check_translation_list(list, keywords); }); /* not tested