From b4c76742f3ed1e562daf4a2d8b81f3b93eff4f2b Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Wed, 28 Jan 2015 13:19:47 +0000 Subject: [PATCH] check translations, part facets, MKWS-365 --- test/spec/mkws-pazpar2.js | 61 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 8 deletions(-) diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index e5140c2..e2ac07b 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -740,6 +740,10 @@ describe("Check SortBy options", function () { describe("Check translations", function () { var $ = mkws.$; + var M = mkws.M; + var lang = function () { + return mkws.config.lang + }; it("check language", function () { var lang = mkws.config.lang; @@ -747,25 +751,66 @@ describe("Check translations", function () { 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("ranking form", function () { var list = $(".mkws-ranking > form > span"); - var lang = mkws.config.lang; expect(list.length).toBe(3); - expect(mkws.M("Sort by")).toBe($(list[0]).text()); - expect(mkws.M("and show")).toBe($(list[1]).text()); - expect(mkws.M("per page")).toBe($(list[2]).text()); + expect($(list[0]).text()).toBe(M("Sort by")); + expect($(list[1]).text()).toBe(M("and show")); + expect($(list[2]).text()).toBe(M("per page")); // double check if (lang == "de") { - expect(mkws.M("Sort by")).toBe("Sortieren nach"); - expect($(list[0]).text()).toBe("Sortieren nach"); + expect("Sortieren nach").toBe(M("Sort by")); + expect("Sortieren nach").toBe($(list[0]).text()); } else if (lang == "da") { - expect(mkws.M("Sort by")).toBe("Sorter efter"); - expect($(list[0]).text()).toBe("Sorter efter"); + expect("Sorter efter").toBe(M("Sort by")); + expect("Sorter efter").toBe($(list[0]).text()); } }); + + it("facets", function () { + var list = $(".mkws-facet-title"); + + expect(list.length).toBe(3); + + expect($(list[0]).text()).toBe(M("Sources")); + expect($(list[1]).text()).toBe(M("Subjects")); + expect($(list[2]).text()).toBe(M("Authors")); + }); }); xdescribe("Check async widget discovery", function () { -- 1.7.10.4