aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-11-16 12:07:33 -0500
committerScott González <scott.gonzalez@gmail.com>2011-11-16 12:07:46 -0500
commit924e80e576e098fd07899bc6e2d5929680d54446 (patch)
tree92b9a20255df56ad997e41ace4817705cc7d2324 /tests/unit
parent97bc2d9de9875e222254cfa1cd3fa3bde605c2ed (diff)
downloadjquery-ui-924e80e576e098fd07899bc6e2d5929680d54446.tar.gz
jquery-ui-924e80e576e098fd07899bc6e2d5929680d54446.zip
Spinner: Handle changes to numberFormat and currency options.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/spinner/spinner_options.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit/spinner/spinner_options.js b/tests/unit/spinner/spinner_options.js
index d954c8b9a..81f434fc6 100644
--- a/tests/unit/spinner/spinner_options.js
+++ b/tests/unit/spinner/spinner_options.js
@@ -96,6 +96,14 @@ test( "numberFormat, currency", function() {
equal( element.val(), "$1.00", "formatted after step" );
});
+test( "numberFormat, change", function() {
+ expect( 2 );
+ var element = $( "#spin" ).val( 5 ).spinner({ numberFormat: "n1" });
+ equal( element.val(), "5.0", "formatted on init" );
+ element.spinner( "option", "numberFormat", "c" );
+ equal( element.val(), "$5.00", "formatted after change" );
+});
+
test( "culture, null", function() {
expect( 2 );
Globalize.culture( "ja-JP" );
@@ -119,6 +127,17 @@ test( "currency, ja-JP", function() {
equal( element.val(), "¥1", "formatted after step" );
});
+test( "currency, change", function() {
+ expect( 2 );
+ var element = $( "#spin" ).val( 5 ).spinner({
+ numberFormat: "C",
+ culture: "ja-JP"
+ });
+ equal( element.val(), "¥5", "formatted on init" );
+ element.spinner( "option", "culture", "en" );
+ equal( element.val(), "$5.00", "formatted after change" );
+});
+
test( "max", function() {
expect( 3 );
var element = $( "#spin" ).val( 1000 ).spinner({ max: 100 });