aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2016-05-18 11:48:47 -0400
committerAlexander Schmitz <arschmitz@gmail.com>2016-06-09 14:10:40 -0400
commit8a79fc87840150f74a5b27f7811db67003bc0c32 (patch)
tree8fd4c056c7402ebab1245459c3d7fc1d774500eb /tests/unit
parent3c860f95aa43c7844883f4417247d2aa6c482151 (diff)
downloadjquery-ui-8a79fc87840150f74a5b27f7811db67003bc0c32.tar.gz
jquery-ui-8a79fc87840150f74a5b27f7811db67003bc0c32.zip
Controlgroup: Add "only" position to class generator functions
Fixes #14972 Closes gh-1711
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/controlgroup/controlgroup.html10
-rw-r--r--tests/unit/controlgroup/core.js60
2 files changed, 70 insertions, 0 deletions
diff --git a/tests/unit/controlgroup/controlgroup.html b/tests/unit/controlgroup/controlgroup.html
index 170676aa8..d90bf607c 100644
--- a/tests/unit/controlgroup/controlgroup.html
+++ b/tests/unit/controlgroup/controlgroup.html
@@ -58,6 +58,16 @@
<label class="ui-controlgroup-label">Label</label>
<button>Button with icon on the bottom</button>
</div>
+ <div class="controlgroup-single-select">
+ <select id="select-single">
+ <option>Fast</option>
+ <option>Medium</option>
+ <option>Slow</option>
+ </select>
+ </div>
+ <div class="controlgroup-single-button">
+ <button class="single-button">button</button>
+ </div>
</div>
</body>
</html>
diff --git a/tests/unit/controlgroup/core.js b/tests/unit/controlgroup/core.js
index b32d829ed..dff3b1b12 100644
--- a/tests/unit/controlgroup/core.js
+++ b/tests/unit/controlgroup/core.js
@@ -100,4 +100,64 @@ QUnit.test( "_resolveClassesValues", function( assert ) {
assertSanatized( assert, "bar", "bar", "No corner classes" );
} );
+QUnit.test( "Single controlgroup select - horizontal", function( assert ) {
+ assert.expect( 4 );
+ var group = $( ".controlgroup-single-select" ).controlgroup();
+ var select = group.find( ".ui-selectmenu-button" );
+
+ assert.hasClasses( select, "ui-corner-all" );
+ assert.lacksClasses( select,
+ "ui-corner-left ui-corner-right ui-corner-top ui-corner-left" +
+ " ui-corner-tr ui-corner-tl ui-corner-bl ui corner-br" );
+
+ group.find( "select" ).selectmenu( "open" );
+ assert.hasClasses( select, "ui-corner-top" );
+ assert.lacksClasses( select,
+ "ui-corner-left ui-corner-right ui-corner-all ui-corner-left" +
+ " ui-corner-tr ui-corner-tl ui-corner-bl ui corner-br" );
+} );
+
+QUnit.test( "Single controlgroup select - vertical", function( assert ) {
+ assert.expect( 4 );
+ var group = $( ".controlgroup-single-select" ).controlgroup( {
+ direction: "verticle"
+ } );
+ var select = group.find( ".ui-selectmenu-button" );
+
+ assert.hasClasses( select, "ui-corner-all" );
+ assert.lacksClasses( select,
+ "ui-corner-left ui-corner-right ui-corner-top ui-corner-left" +
+ " ui-corner-tr ui-corner-tl ui-corner-bl ui corner-br" );
+
+ group.find( "select" ).selectmenu( "open" );
+ assert.hasClasses( select, "ui-corner-top" );
+ assert.lacksClasses( select,
+ "ui-corner-left ui-corner-right ui-corner-all ui-corner-left" +
+ " ui-corner-tr ui-corner-tl ui-corner-bl ui corner-br" );
+} );
+
+QUnit.test( "Single controlgroup button - horizontal", function( assert ) {
+ assert.expect( 2 );
+ var group = $( ".controlgroup-single-button" ).controlgroup();
+ var button = group.find( "button" );
+
+ assert.hasClasses( button, "ui-corner-all" );
+ assert.lacksClasses( button,
+ "ui-corner-left ui-corner-right ui-corner-top ui-corner-left" +
+ " ui-corner-tr ui-corner-tl ui-corner-bl ui corner-br" );
+} );
+
+QUnit.test( "Single controlgroup button - vertical", function( assert ) {
+ assert.expect( 2 );
+ var group = $( ".controlgroup-single-button" ).controlgroup( {
+ direction: "verticle"
+ } );
+ var button = group.find( "button" );
+
+ assert.hasClasses( button, "ui-corner-all" );
+ assert.lacksClasses( button,
+ "ui-corner-left ui-corner-right ui-corner-top ui-corner-left" +
+ " ui-corner-tr ui-corner-tl ui-corner-bl ui corner-br" );
+} );
+
} );