diff --git a/dev/js/spec/pageInfoSpec.js b/dev/js/spec/pageInfoSpec.js
new file mode 100644
index 0000000..4082bb4
--- /dev/null
+++ b/dev/js/spec/pageInfoSpec.js
@@ -0,0 +1,31 @@
+define(['pageInfo'], function (pageInfoClass) {
+
+  describe('KorAP.PageInfo', function () {
+    it('should be initializable', function () {
+      let pi = pageInfoClass.create();
+      expect(pi.total()).toEqual(0);
+      expect(pi.count()).toEqual(0);
+      expect(pi.page()).toEqual(0);
+    });
+
+    it('should be read the correct values', function () {
+
+      // Create pagination element for pagination information
+      let p = document.createElement('div');
+      p.setAttribute('id', 'pagination')
+      p.setAttribute('data-page',3);
+      p.setAttribute('data-total',30);
+      p.setAttribute('data-count',25);
+
+      document.body.appendChild(p);
+      
+      pi = pageInfoClass.create();
+      expect(pi.total()).toEqual(30);
+      expect(pi.count()).toEqual(25);
+      expect(pi.page()).toEqual(3);
+
+      // Recreate initial state
+      document.body.removeChild(p);
+    });
+  });
+});
diff --git a/dev/js/spec/pluginSpec.js b/dev/js/spec/pluginSpec.js
index 966d123..edffa59 100644
--- a/dev/js/spec/pluginSpec.js
+++ b/dev/js/spec/pluginSpec.js
@@ -623,7 +623,7 @@
       KorAP.Pipe = temp;
     });
 
-    it('should reply to query information requests', function () {
+    it('should reply to query information requests (queryform)', function () {
       var manager = pluginServerClass.create();
       var id = manager.addService({"name":'Service', "src":'about:blank'});
       expect(id).toMatch(/^id-/);
@@ -660,9 +660,41 @@
       expect(data.value["q"]).toEqual("[orth=Baum]");
       expect(data.value["ql"]).toEqual("poliqarp");
       expect(data.value["cq"]).toEqual("title = /[^b]ee.+?/");
+
       // Recreate initial state
       KorAP.vc = temp;
       document.body.removeChild(f);
     });
+
+    it('should reply to query information requests (pagination)', function () {
+      var manager = pluginServerClass.create();
+      var id = manager.addService({"name":'Service', "src":'about:blank'});
+      expect(id).toMatch(/^id-/);
+      
+      // Create pagination element for pagination information
+      let p = document.createElement('div');
+      p.setAttribute('id', 'pagination')
+      p.setAttribute('data-page',3);
+      p.setAttribute('data-total',30);
+      p.setAttribute('data-count',25);
+
+      document.body.appendChild(p);
+
+      let data = {
+        "originID" : id,
+        "action" : "get",
+        "key" : "Pagination"
+      };
+      manager._receiveMsg({
+        "data" : data
+      });
+      manager.destroy();
+      expect(data.value["count"]).toEqual(25);
+      expect(data.value["page"]).toEqual(3);
+      expect(data.value["total"]).toEqual(30);
+
+      // Recreate initial state
+      document.body.removeChild(p);
+    });
   });
 });
