check translations, part navigation, MKWS-365
authorWolfram Schneider <wosch@indexdata.dk>
Wed, 28 Jan 2015 13:38:09 +0000 (13:38 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Wed, 28 Jan 2015 13:38:09 +0000 (13:38 +0000)
src/templates/pager.handlebars
test/spec/mkws-pazpar2.js

index 61768ed..0b3f953 100644 (file)
@@ -14,9 +14,9 @@ pages:
   click - script to go to this page unless it is the current one
 }}
 <div class="mkws-pager-desc">
-  {{mkws-translate "Displaying"}}:
-  {{first}} {{mkws-translate "to"}} {{last}}
-  {{mkws-translate "of"}} {{count}} ({{{mkws-translate "found"}}}: {{found}})
+  <span>{{mkws-translate "Displaying"}}</span>:
+  {{first}} <span>{{mkws-translate "to"}}</span> {{last}}
+  <span>{{mkws-translate "of"}}</span> {{count}} (<span>{{{mkws-translate "found"}}}</span>: {{found}})
 </div>
 
 <div class="mkws-pager-list">
index e2ac07b..cb7e426 100644 (file)
@@ -740,7 +740,10 @@ describe("Check SortBy options", function () {
 
 describe("Check translations", function () {
     var $ = mkws.$;
-    var M = mkws.M;
+    // handle html entities, "Zur&uuml;ck" => "Zurück"
+    var M = function (string) {
+            return $("<span/>").html(mkws.M(string)).text()
+        };
     var lang = function () {
             return mkws.config.lang
         };
@@ -802,7 +805,7 @@ describe("Check translations", function () {
         }
     });
 
-    it("facets", function () {
+    xit("facets", function () {
         var list = $(".mkws-facet-title");
 
         expect(list.length).toBe(3);
@@ -811,6 +814,20 @@ describe("Check translations", function () {
         expect($(list[1]).text()).toBe(M("Subjects"));
         expect($(list[2]).text()).toBe(M("Authors"));
     });
+
+    it("navigation", function () {
+        var list = $(".mkws-pager-desc > span");
+
+        expect(list.length).toBe(4);
+
+        expect($(list[0]).text()).toBe(M("Displaying"));
+        expect($(list[1]).text()).toBe(M("to"));
+        expect($(list[2]).text()).toBe(M("of"));
+        expect($(list[3]).text()).toBe(M("found"));
+
+        expect($(".mkws-next").text()).toBe(M("Next"));
+        expect($(".mkws-prev").text()).toBe(M("Prev"));
+    });
 });
 
 xdescribe("Check async widget discovery", function () {