From 8976bc7e3d1f03254f914297b1be1b730690d2b8 Mon Sep 17 00:00:00 2001 From: Kris Borchers Date: Thu, 8 Nov 2012 12:02:25 -0600 Subject: Progressbar: Refactor to better handle option changes and sanitize values. Fixes #8785 - Progressbar: Remove _value() and always sanitize value option --- tests/unit/progressbar/progressbar_options.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/unit/progressbar/progressbar_options.js b/tests/unit/progressbar/progressbar_options.js index fd5988ebd..e4d9b7ab8 100644 --- a/tests/unit/progressbar/progressbar_options.js +++ b/tests/unit/progressbar/progressbar_options.js @@ -60,3 +60,21 @@ test( "{ max : 5, value : 10 }", function() { }); deepEqual( 5, $( "#progressbar" ).progressbar( "value" ) ); }); + +test( "{ value : 10, max : 5 }", function() { + expect( 1 ); + $("#progressbar").progressbar({ + max: 5, + value: 10 + }); + deepEqual( 5, $( "#progressbar" ).progressbar( "value" ) ); +}); + +test( "{ max : 5 }", function() { + expect( 1 ); + $("#progressbar").progressbar({ + max: 10, + value: 10 + }).progressbar( "option", "max", 5 ); + deepEqual( 5, $( "#progressbar" ).progressbar( "value" ) ); +}); -- cgit v1.2.3