From f50d9f0a954db2c4e17380d16273388910188590 Mon Sep 17 00:00:00 2001 From: Chi Cheng Date: Mon, 18 Aug 2008 11:44:42 +0000 Subject: [PATCH] home key to start if min not set. --- tests/spinner.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/spinner.js b/tests/spinner.js index a27c5bd37..ca664b2e2 100644 --- a/tests/spinner.js +++ b/tests/spinner.js @@ -47,7 +47,7 @@ test("set defaults on init", function() { }); test("keydown on input", function() { - expect(5); + expect(6); el = $("#spin").spinner(); equals(el.val(), 0, "start number"); @@ -62,15 +62,20 @@ test("keydown on input", function() { 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}) .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}) .simulate("keyup",{keyCode:$.simulate.VK_LEFT}); - equals(el.val(), 0, "Left Key"); + equals(el.val(), -2, "Left Key"); });