Skip to content
Permalink
Browse files

Spinner test: a bug when set stepping:0.3

  • Loading branch information
chicheng committed Aug 19, 2008
1 parent 9da87e2 commit 1de76c6f779a9939a9114f56018e6d52846157e0
Showing with 11 additions and 3 deletions.
  1. +11 −3 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");


});

0 comments on commit 1de76c6

Please sign in to comment.
You can’t perform that action at this time.