aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/controlgroup
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2015-10-25 18:07:34 -0400
committerJörn Zaefferer <joern.zaefferer@gmail.com>2015-10-26 10:09:20 -0400
commit09fde89a248895329a194021c44aa9004cb7fa97 (patch)
tree51061b433caa443a1e393dc6725ad809cd670456 /tests/unit/controlgroup
parentbb56dd59e832177786a199f7a1f6acabdb7f8f6e (diff)
downloadjquery-ui-09fde89a248895329a194021c44aa9004cb7fa97.tar.gz
jquery-ui-09fde89a248895329a194021c44aa9004cb7fa97.zip
Controlgroup: Fix create and destroy for controlgroupLabel
Creating the label broke while doing a refactoring, the lack of tests allowed that to go unnoticed. Shouldn't happen again with the extra tests, covering both controlgroupLabel and spinner.
Diffstat (limited to 'tests/unit/controlgroup')
-rw-r--r--tests/unit/controlgroup/controlgroup.html4
-rw-r--r--tests/unit/controlgroup/core.js13
2 files changed, 13 insertions, 4 deletions
diff --git a/tests/unit/controlgroup/controlgroup.html b/tests/unit/controlgroup/controlgroup.html
index e150c2c3f..9767381ac 100644
--- a/tests/unit/controlgroup/controlgroup.html
+++ b/tests/unit/controlgroup/controlgroup.html
@@ -5,7 +5,7 @@
<title>jQuery UI Controlgroup Test Suite</title>
<script src="../../../external/requirejs/require.js"></script>
- <script src="../../lib/css.js" data-modules="core button checkboxradio selectmenu controlgroup"></script>
+ <script src="../../lib/css.js" data-modules="core button checkboxradio selectmenu spinner controlgroup"></script>
<script src="../../lib/bootstrap.js" data-modules="common core methods options"></script>
</head>
<body>
@@ -28,6 +28,8 @@
</select>
<div class="test"></div>
<button>Button with icon on the bottom</button>
+ <label for="spinner" class="ui-controlgroup-label"># of cars</label>
+ <input id="spinner" class="ui-spinner-input">
<select>
<option>Fast</option>
<option>Medium</option>
diff --git a/tests/unit/controlgroup/core.js b/tests/unit/controlgroup/core.js
index 43acdd665..775d22ade 100644
--- a/tests/unit/controlgroup/core.js
+++ b/tests/unit/controlgroup/core.js
@@ -9,13 +9,11 @@ define( [
module( "Controlgroup: Core" );
test( "selectmenu: open/close corners", function( assert ) {
- expect( 1 );
+ expect( 12 );
var element = $( ".controlgroup" ).controlgroup(),
selects = element.find( "select" ),
selectButton = selects.eq( 0 ).selectmenu( "widget" );
- expect( 12 );
-
selects.eq( 0 ).selectmenu( "open" );
assert.hasClasses( selectButton, "ui-corner-tl",
"Horizontal: First selectmenu gets ui-corner-tl when opened" );
@@ -66,4 +64,13 @@ test( "selectmenu: open/close corners", function( assert ) {
"vertical: Last selectmenu gets ui-corner-bottom when closed" );
} );
+test( "selectmenu: controlgroupLabel", function( assert ) {
+ expect( 2 );
+ var element = $( ".controlgroup" ).controlgroup();
+ var label = element.find( ".ui-controlgroup-label" );
+
+ assert.hasClasses( label, "ui-widget ui-widget-content ui-state-default ui-controlgroup-item" );
+ assert.hasClasses( label.find( "span" ), "ui-controlgroup-label-contents" );
+} );
+
} );