Button: Add tests for button with html markup

Ref gh-1632
Ref jquery/api.jqueryui.com#281
This commit is contained in:
Jörn Zaefferer
2015-10-28 19:04:09 +01:00
parent 9644e7bae9
commit f1b643ec67
3 changed files with 11 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
<div id="qunit-fixture">
<form id="form1">
<div><button id="button">Label</button></div>
<div><button id="button2">label <span>with span</span></button></div>
<div><input id="submit" type="submit" value="Label"></div>
</form>

View File

@@ -14,6 +14,7 @@
<div id="qunit-fixture">
<div class="buttonset"><button id="button">Label</button><button>button 2</button></div>
<div><button id="button2">label <span>with span</span></button></div>
<div id="radio0" style="margin-top: 2em;">
<input type="radio" id="radio01" name="radio" checked="checked"><label for="radio01">Choice 1</label>

View File

@@ -76,6 +76,15 @@ test( "label, default", function() {
deepEqual( button.button( "option", "label" ), "Label" );
} );
test( "label, with html markup", function() {
expect( 3 );
var button = $( "#button2" ).button();
deepEqual( button.text(), "label with span" );
deepEqual( button.html().toLowerCase(), "label <span>with span</span>" );
deepEqual( button.button( "option", "label" ).toLowerCase(), "label <span>with span</span>" );
} );
test( "label, explicit value", function() {
expect( 2 );
var button = $( "#button" ).button( {