home key to start if min not set.

This commit is contained in:
Chi Cheng 2008-08-18 11:44:42 +00:00
parent da0ebd589e
commit f50d9f0a95

View File

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