diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-10-28 19:04:09 +0100 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-10-29 15:45:26 +0100 |
commit | f1b643ec67c7c8d96e1612c4b7d73fc49b6ae3cd (patch) | |
tree | d22cd9c71786c9d207043d896be57db6c39ce344 | |
parent | 9644e7bae9116edaf8d37c5b38cb32b892f10ff6 (diff) | |
download | jquery-ui-f1b643ec67c7c8d96e1612c4b7d73fc49b6ae3cd.tar.gz jquery-ui-f1b643ec67c7c8d96e1612c4b7d73fc49b6ae3cd.zip |
Button: Add tests for button with html markup
Ref gh-1632
Ref jquery/api.jqueryui.com#281
-rw-r--r-- | tests/unit/button/button.html | 1 | ||||
-rw-r--r-- | tests/unit/button/deprecated.html | 1 | ||||
-rw-r--r-- | tests/unit/button/options.js | 9 |
3 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit/button/button.html b/tests/unit/button/button.html index 09b5a4c23..6cf27fb33 100644 --- a/tests/unit/button/button.html +++ b/tests/unit/button/button.html @@ -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> diff --git a/tests/unit/button/deprecated.html b/tests/unit/button/deprecated.html index 788d2eeeb..73f62921c 100644 --- a/tests/unit/button/deprecated.html +++ b/tests/unit/button/deprecated.html @@ -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> diff --git a/tests/unit/button/options.js b/tests/unit/button/options.js index 077d868e3..6ef166974 100644 --- a/tests/unit/button/options.js +++ b/tests/unit/button/options.js @@ -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( { |