});
// avoid race conditions of source facets updates
- it("wait a little bit for source facets", function () {
+ it("wait a little bit for a source facets update", function () {
// wait a half second, to show the target view
var waittime = 0.5;
var time = (new Date).getTime();
waitsFor(function () {
- return (new Date).getTime() - time > waittime * jasmine_config.second ? true : false;
+ return (new Date).getTime() - time > (waittime * jasmine_config.second) ? true : false;
}, "wait some miliseconds", (waittime + 0.5) * jasmine_config.second);
runs(function () {});
});
});
+// temporary disabled due records without an author, MKWS-400
describe("Check translations", function () {
var $ = mkws.$;
debug("translate check for: " + text);
return text;
};
+
var lang = function () {
return mkws.config.lang
};
expect(list.length).toBe(text.length);
for (var i = 0; i < text.length; i++) {
- expect($(list[i]).text()).toBe(M(text[i]));
+ expect($(list[i]).text().match(M(text[i]))).not.toBeNull();
}
}
+ 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);
"Date": "Datum",
"Subject": "Schlagwort",
"subject": "schlagwort",
- "Location": "Ort",
+ "Location": "Bestand",
+ "Locations": "Bestand",
"Records": "Datensätze",
"Targets": "Datenbanken",
"relevance": "Relevanz",
check_translation(list, text);
- expect($(".mkws-next").text()).toBe(M("Next"));
- expect($(".mkws-prev").text()).toBe(M("Prev"));
+ expect($(".mkws-next").text().match(M("Next"))).not.toBeNull();
+ expect($(".mkws-next").text().match(M("NextXXX"))).toBeNull();
+ expect($(".mkws-prev").text().match(M("Prev"))).not.toBeNull();
});
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