aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/selectmenu
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2014-12-03 11:26:46 -0500
committerAlexander Schmitz <arschmitz@gmail.com>2015-03-11 16:05:07 -0400
commit3483486a153f6f7b3a8bbe9783735eb63adfd033 (patch)
tree88e3a3ab136b1cc3741b4f7a49915d284e96c040 /tests/unit/selectmenu
parent2a7873dd5711db472a87f749e698e80c49ccf8cd (diff)
downloadjquery-ui-3483486a153f6f7b3a8bbe9783735eb63adfd033.tar.gz
jquery-ui-3483486a153f6f7b3a8bbe9783735eb63adfd033.zip
Selectmenu: Add classes option
Ref #7053 Ref gh-1411
Diffstat (limited to 'tests/unit/selectmenu')
-rw-r--r--tests/unit/selectmenu/selectmenu.html1
-rw-r--r--tests/unit/selectmenu/selectmenu_common.js5
-rw-r--r--tests/unit/selectmenu/selectmenu_core.js15
3 files changed, 20 insertions, 1 deletions
diff --git a/tests/unit/selectmenu/selectmenu.html b/tests/unit/selectmenu/selectmenu.html
index 618eea3d0..c9a399ad5 100644
--- a/tests/unit/selectmenu/selectmenu.html
+++ b/tests/unit/selectmenu/selectmenu.html
@@ -9,6 +9,7 @@
<script src="../../../external/qunit/qunit.js"></script>
<script src="../../../external/jquery-simulate/jquery.simulate.js"></script>
<script src="../testsuite.js"></script>
+ <script src="../../../external/qunit-assert-classes/qunit-assert-classes.js"></script>
<script>
TestHelpers.loadResources({
css: [ "core", "menu" , "selectmenu" ],
diff --git a/tests/unit/selectmenu/selectmenu_common.js b/tests/unit/selectmenu/selectmenu_common.js
index cb8712e7b..f741eaf27 100644
--- a/tests/unit/selectmenu/selectmenu_common.js
+++ b/tests/unit/selectmenu/selectmenu_common.js
@@ -1,7 +1,10 @@
TestHelpers.commonWidgetTests( "selectmenu", {
defaults: {
appendTo: null,
- classes: {},
+ classes: {
+ "ui-selectmenu-button-open": "ui-corner-top",
+ "ui-selectmenu-button-closed": "ui-corner-all"
+ },
disabled: null,
icons: {
button: "ui-icon-triangle-1-s"
diff --git a/tests/unit/selectmenu/selectmenu_core.js b/tests/unit/selectmenu/selectmenu_core.js
index 0a2431861..1116bd604 100644
--- a/tests/unit/selectmenu/selectmenu_core.js
+++ b/tests/unit/selectmenu/selectmenu_core.js
@@ -2,6 +2,21 @@
module( "selectmenu: core" );
+test( "markup structure", function( assert ) {
+ expect( 4 );
+
+ var element = $( "#files" ).selectmenu(),
+ button = element.selectmenu( "widget" ),
+ menu = element.selectmenu( "menuWidget" ),
+ menuWrap = menu.parent();
+
+ assert.hasClasses( button,
+ "ui-selectmenu-button ui-selectmenu-button-closed ui-widget" );
+ assert.lacksClasses( button, "ui-selectmenu-button-open" );
+ assert.hasClasses( menuWrap, "ui-selectmenu-menu" );
+ assert.lacksClasses( menuWrap, "ui-selectmenu-menu-open" );
+});
+
asyncTest( "accessibility", function() {
var wrappers, button, menu,
element = $( "#speed" ).attr( "title", "A demo title" );