aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2016-11-16 12:52:15 -0500
committerScott González <scott.gonzalez@gmail.com>2016-11-16 12:52:15 -0500
commita2b25ef6caae3e1a272214839b815a6387618124 (patch)
treefe0b441544fcce9e597109bde89348e1f6256eb4 /tests
parent9a4c0571577e20795c19796594747f0f8beb476a (diff)
downloadjquery-ui-a2b25ef6caae3e1a272214839b815a6387618124.tar.gz
jquery-ui-a2b25ef6caae3e1a272214839b815a6387618124.zip
Selectmenu: Don't render options with the `hidden` attribute
Fixes #15098
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/selectmenu/core.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/unit/selectmenu/core.js b/tests/unit/selectmenu/core.js
index a5bc68e0f..cef6dc5bf 100644
--- a/tests/unit/selectmenu/core.js
+++ b/tests/unit/selectmenu/core.js
@@ -376,4 +376,30 @@ QUnit.test( "Number pad input should change value", function( assert ) {
} );
} );
+QUnit.test( "Options with hidden attribute should not be rendered", function( assert ) {
+ var ready = assert.async();
+ assert.expect( 1 );
+
+ var button, menu, options,
+ element = $( "#speed" );
+
+ element.find( "option" ).eq( 1 ).prop( "hidden", true );
+ element.selectmenu();
+ button = element.selectmenu( "widget" );
+ menu = element.selectmenu( "menuWidget" );
+
+ button.simulate( "focus" );
+ setTimeout( function() {
+ button.trigger( "click" );
+ options = menu.children()
+ .map( function() {
+ return $( this ).text();
+ } )
+ .get();
+ assert.deepEqual( options, [ "Slower", "Medium", "Fast", "Faster" ], "correct elements" );
+
+ ready();
+ } );
+} );
+
} );