aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/selectmenu/core.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2015-10-26 13:13:42 -0400
committerJörn Zaefferer <joern.zaefferer@gmail.com>2015-10-27 10:28:04 -0400
commit39853fda45a409e9dc47d7358fbd9b03ad1d33b5 (patch)
tree6d27d571a5c59a38a10f7fbef5af5f3cdb5945a8 /tests/unit/selectmenu/core.js
parent4e13860067ab6809d260d486ac24d63b30cc664d (diff)
downloadjquery-ui-39853fda45a409e9dc47d7358fbd9b03ad1d33b5.tar.gz
jquery-ui-39853fda45a409e9dc47d7358fbd9b03ad1d33b5.zip
Selectmenu: Handle form resets
Fixes #12236 Ref gh-1550
Diffstat (limited to 'tests/unit/selectmenu/core.js')
-rw-r--r--tests/unit/selectmenu/core.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unit/selectmenu/core.js b/tests/unit/selectmenu/core.js
index 689668e70..1c1a6b622 100644
--- a/tests/unit/selectmenu/core.js
+++ b/tests/unit/selectmenu/core.js
@@ -329,4 +329,22 @@ $.each( [
} );
} );
+ asyncTest( "Selectmenu should reset when its parent form resets", function() {
+ expect( 2 );
+
+ var element = $( "#speed" ).selectmenu(),
+ widget = element.selectmenu( "widget" ),
+ initialValue = element.val(),
+ form = element.closest( "form" );
+
+ element.val( "Slower" );
+ element.selectmenu( "refresh" );
+ equal( $.trim( widget.text() ), "Slower" );
+ form[ 0 ].reset();
+ setTimeout( function() {
+ equal( $.trim( widget.text() ), initialValue );
+ start();
+ } );
+ } );
+
} );