});\r
\r
test("keydown on input", function() {\r
- expect(5);\r
+ expect(6);\r
el = $("#spin").spinner();\r
\r
equals(el.val(), 0, "start number");\r
\r
equals(el.val(), 2, "Right key");\r
\r
+ el.simulate("keydown",{keyCode:$.simulate.VK_HOME})\r
+ .simulate("keyup",{keyCode:$.simulate.VK_HOME});\r
+\r
+ equals(el.val(), 0, "Home key to start");\r
+\r
el.simulate("keydown",{keyCode:$.simulate.VK_DOWN})\r
.simulate("keyup",{keyCode:$.simulate.VK_DOWN});\r
\r
- equals(el.val(), 1, "Down Key");\r
+ equals(el.val(), -1, "Down Key");\r
\r
el.simulate("keydown",{keyCode:$.simulate.VK_LEFT})\r
.simulate("keyup",{keyCode:$.simulate.VK_LEFT});\r
\r
- equals(el.val(), 0, "Left Key");\r
+ equals(el.val(), -2, "Left Key");\r
\r
});\r
\r