Skip to content
Permalink
Browse files

Spinner test: spin without auto-incremental stepping

  • Loading branch information
chicheng committed Aug 19, 2008
1 parent 2ac541d commit 951312cfcb1c7d7f74eb356c9c17695deb9068ce
Showing with 23 additions and 0 deletions.
  1. +23 −0 tests/spinner.js
@@ -104,6 +104,29 @@ test("keydown on input with options", function() {

});

test("spin without auto-incremental stepping", function() {
expect(2);

el = $("#spin").spinner({ incremental:false });

for ( var i = 1 ; i<=120 ; i++ ) {
el.simulate("keydown",{keyCode:$.simulate.VK_UP});
}

el.simulate("keyup",{keyCode:$.simulate.VK_UP});

equals(el.val(), 120, "keydown 120 times");

for ( var i = 1 ; i<=210 ; i++ ) {
el.simulate("keydown",{keyCode:$.simulate.VK_DOWN});
}

el.simulate("keyup",{keyCode:$.simulate.VK_DOWN});

equals(el.val(), -90, "keydown 210 times");

});

test("spin with auto-incremental stepping", function() {
expect(2);

0 comments on commit 951312c

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