Skip to content

Commit f1b643e

Browse files
committed
Button: Add tests for button with html markup
Ref jquerygh-1632 Ref jquery/api.jqueryui.com#281
1 parent 9644e7b commit f1b643e

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

tests/unit/button/button.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<div id="qunit-fixture">
1515
<form id="form1">
1616
<div><button id="button">Label</button></div>
17+
<div><button id="button2">label <span>with span</span></button></div>
1718

1819
<div><input id="submit" type="submit" value="Label"></div>
1920
</form>

tests/unit/button/deprecated.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<div id="qunit-fixture">
1515

1616
<div class="buttonset"><button id="button">Label</button><button>button 2</button></div>
17+
<div><button id="button2">label <span>with span</span></button></div>
1718

1819
<div id="radio0" style="margin-top: 2em;">
1920
<input type="radio" id="radio01" name="radio" checked="checked"><label for="radio01">Choice 1</label>

tests/unit/button/options.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ test( "label, default", function() {
7676
deepEqual( button.button( "option", "label" ), "Label" );
7777
} );
7878

79+
test( "label, with html markup", function() {
80+
expect( 3 );
81+
var button = $( "#button2" ).button();
82+
83+
deepEqual( button.text(), "label with span" );
84+
deepEqual( button.html().toLowerCase(), "label <span>with span</span>" );
85+
deepEqual( button.button( "option", "label" ).toLowerCase(), "label <span>with span</span>" );
86+
} );
87+
7988
test( "label, explicit value", function() {
8089
expect( 2 );
8190
var button = $( "#button" ).button( {

0 commit comments

Comments
 (0)