aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/progressbar/progressbar_events.js
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2012-12-12 16:44:19 +0100
committerFelix Nagel <info@felixnagel.com>2012-12-12 16:44:19 +0100
commitf6372bd7eac41ae2c022ef510ec414d016e820ed (patch)
treeb764593154e334e03701dbc896dbac0154c5d136 /tests/unit/progressbar/progressbar_events.js
parentd1350f9f1113ef5590ec010f16da7068646aec01 (diff)
parent747d8534520fc3abad81b3c171fa931149398d99 (diff)
downloadjquery-ui-f6372bd7eac41ae2c022ef510ec414d016e820ed.tar.gz
jquery-ui-f6372bd7eac41ae2c022ef510ec414d016e820ed.zip
Merge branch 'master' into selectmenu
Diffstat (limited to 'tests/unit/progressbar/progressbar_events.js')
-rw-r--r--tests/unit/progressbar/progressbar_events.js26
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/unit/progressbar/progressbar_events.js b/tests/unit/progressbar/progressbar_events.js
index fe05182a1..95effda75 100644
--- a/tests/unit/progressbar/progressbar_events.js
+++ b/tests/unit/progressbar/progressbar_events.js
@@ -5,34 +5,40 @@ test( "create", function() {
$( "#progressbar" ).progressbar({
value: 5,
create: function() {
- deepEqual( 5, $( this ).progressbar( "value" ) );
+ equal( $( this ).progressbar( "value" ), 5, "Correct value at create" );
},
change: function() {
- ok( false, "create() has triggered change()" );
+ ok( false, "create has triggered change()" );
}
});
});
test( "change", function() {
- expect( 1 );
- $( "#progressbar" ).progressbar({
- change: function() {
- deepEqual( 5, $( thisĀ ).progressbar( "value" ) );
- }
- }).progressbar( "value", 5 );
+ expect( 2 );
+ var element = $( "#progressbar" ).progressbar();
+
+ element.one( "progressbarchange", function() {
+ equal( element.progressbar( "value" ), 5, "change triggered for middle value" );
+ });
+ element.progressbar( "value", 5 );
+ element.one( "progressbarchange", function() {
+ equal( element.progressbar( "value" ), 100, "change triggered for final value" );
+ });
+ element.progressbar( "value", 100 );
});
test( "complete", function() {
- expect( 4 );
+ expect( 5 );
var value,
changes = 0,
element = $( "#progressbar" ).progressbar({
change: function() {
changes++;
- deepEqual( element.progressbar( "value" ), value, "change at " + value );
+ equal( element.progressbar( "value" ), value, "change at " + value );
},
complete: function() {
equal( changes, 3, "complete triggered after change and not on indeterminate" );
+ equal( element.progressbar( "value" ), 100, "value is 100" );
}
});