diff options
author | Chi Cheng <cloudream@gmail.com> | 2008-08-19 06:24:24 +0000 |
---|---|---|
committer | Chi Cheng <cloudream@gmail.com> | 2008-08-19 06:24:24 +0000 |
commit | 951312cfcb1c7d7f74eb356c9c17695deb9068ce (patch) | |
tree | 2a8f4680bd479d20ba25adbda13d8204a3a58f3c /tests/spinner.js | |
parent | 2ac541d500f4e92452a2195483c3f118a5ac4a32 (diff) | |
download | jquery-ui-951312cfcb1c7d7f74eb356c9c17695deb9068ce.tar.gz jquery-ui-951312cfcb1c7d7f74eb356c9c17695deb9068ce.zip |
Spinner test: spin without auto-incremental stepping
Diffstat (limited to 'tests/spinner.js')
-rw-r--r-- | tests/spinner.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/spinner.js b/tests/spinner.js index 76ecee408..53801d5a7 100644 --- a/tests/spinner.js +++ b/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);
|