diff --git a/dev/js/spec/datepickerSpec.js b/dev/js/spec/datepickerSpec.js
new file mode 100644
index 0000000..bcab225
--- /dev/null
+++ b/dev/js/spec/datepickerSpec.js
@@ -0,0 +1,84 @@
+define(['datepicker'], function (dpClass) {
+  describe('KorAP.Datepicker', function () {
+
+    it('should be initializable', function () {
+      var dp = dpClass.create();
+      var e = dp.show();
+      expect(e.nodeName).toEqual('DIV');
+      expect(e.classList.contains('datepicker')).toBeTruthy();
+      expect(e.getAttribute('tabindex')).toEqual('0');
+    });
+
+    it('should generate valid dates', function () {
+      var dp = dpClass.create();
+      expect(dp.today()).toMatch("\\d{4}-[01\\d-[01]\\d");
+    });    
+
+    it('should have year and month helpers', function () {
+      var dp = dpClass.create();
+      var e = dp.show(2013, 2);
+      expect(e.nodeName).toEqual('DIV');
+      expect(e.classList.contains('datepicker')).toBeTruthy();
+      expect(e.getAttribute('tabindex')).toEqual('0');
+      expect(e.querySelector('div.year > span:nth-child(2)').firstChild.data).toEqual('2013');
+      expect(e.querySelector('div.month > span:nth-child(2)').firstChild.data).toEqual('February');
+    });
+
+    it('should have modifyable year', function () {
+      var dp = dpClass.create();
+      var e = dp.show(2013, 2);
+      expect(e.nodeName).toEqual('DIV');
+      expect(e.classList.contains('datepicker')).toBeTruthy();
+      expect(e.getAttribute('tabindex')).toEqual('0');
+      expect(e.querySelector('div.year > span:nth-child(2)').firstChild.data).toEqual('2013');
+      expect(e.querySelector('div.month > span:nth-child(2)').firstChild.data).toEqual('February');
+
+      dp.incrYear();
+      expect(e.querySelector('div.year > span:nth-child(2)').firstChild.data).toEqual('2014');
+      expect(e.querySelector('div.month > span:nth-child(2)').firstChild.data).toEqual('February');
+
+      dp.incrYear();
+      expect(e.querySelector('div.year > span:nth-child(2)').firstChild.data).toEqual('2015');
+      expect(e.querySelector('div.month > span:nth-child(2)').firstChild.data).toEqual('February');
+
+      dp.decrYear();
+      expect(e.querySelector('div.year > span:nth-child(2)').firstChild.data).toEqual('2014');
+      expect(e.querySelector('div.month > span:nth-child(2)').firstChild.data).toEqual('February');
+
+      // Max value
+      var e = dp.show(9998, 2);
+      expect(e.querySelector('div.year > span:nth-child(2)').firstChild.data).toEqual('9998');
+      expect(e.querySelector('div.month > span:nth-child(2)').firstChild.data).toEqual('February');
+
+      dp.incrYear();
+      expect(e.querySelector('div.year > span:nth-child(2)').firstChild.data).toEqual('9999');
+      expect(e.querySelector('div.month > span:nth-child(2)').firstChild.data).toEqual('February');
+
+      dp.incrYear();
+      expect(e.querySelector('div.year > span:nth-child(2)').firstChild.data).toEqual('9999');
+      expect(e.querySelector('div.month > span:nth-child(2)').firstChild.data).toEqual('February');
+
+      // Min value
+      var e = dp.show(2, 2);
+      expect(e.querySelector('div.year > span:nth-child(2)').firstChild.data).toEqual('2');
+      expect(e.querySelector('div.month > span:nth-child(2)').firstChild.data).toEqual('February');
+
+      dp.decrYear();
+      expect(e.querySelector('div.year > span:nth-child(2)').firstChild.data).toEqual('1');
+      expect(e.querySelector('div.month > span:nth-child(2)').firstChild.data).toEqual('February');
+
+      dp.decrYear();
+      expect(e.querySelector('div.year > span:nth-child(2)').firstChild.data).toEqual('0');
+      expect(e.querySelector('div.month > span:nth-child(2)').firstChild.data).toEqual('February');
+
+      dp.decrYear();
+      expect(e.querySelector('div.year > span:nth-child(2)').firstChild.data).toEqual('0');
+      expect(e.querySelector('div.month > span:nth-child(2)').firstChild.data).toEqual('February');
+    });
+
+    it('should have modifyable month', function () {
+      var dp = dpClass.create();
+      var e = dp.show(2013, 6);
+    });
+  });
+});
