From 1de76c6f779a9939a9114f56018e6d52846157e0 Mon Sep 17 00:00:00 2001 From: Chi Cheng Date: Tue, 19 Aug 2008 08:56:48 +0000 Subject: Spinner test: a bug when set stepping:0.3 --- tests/spinner.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/spinner.js b/tests/spinner.js index 3447004a9..a09588ff7 100644 --- a/tests/spinner.js +++ b/tests/spinner.js @@ -139,16 +139,16 @@ test("keydown on input with options", function() { }); test("currency and decimal options", function() { - expect(4); + expect(5); - el = $("#spin").spinner({ currency:"$", incremental:false, max:120, min:-50, stepping:0.15 }); + el = $("#spin").spinner({ currency:"$", incremental:false, max:120, min:-50, stepping:0.3 }); equals(el.val(), "$0.00", "start number"); el.simulate("keydown",{keyCode:$.simulate.VK_UP}) .simulate("keyup",{keyCode:$.simulate.VK_UP}); - equals(el.val(), "$0.15", "Stepping 0.15"); + equals(el.val(), "$0.30", "Stepping 0.30"); el.simulate("keydown",{keyCode:$.simulate.VK_END}) .simulate("keyup",{keyCode:$.simulate.VK_END}); @@ -160,6 +160,14 @@ test("currency and decimal options", function() { equals(el.val(), "-$50.00", "Home key to min"); + for ( var i = 1 ; i<=120 ; i++ ) { + el.simulate("keydown",{keyCode:$.simulate.VK_UP}); + } + + el.simulate("keyup",{keyCode:$.simulate.VK_UP}); + + equals(el.val(), "-$14.00", "keydown 120 times"); + }); -- cgit v1.2.3