aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/dialog
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2015-10-28 19:11:07 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2015-10-28 19:48:35 +0100
commit9644e7bae9116edaf8d37c5b38cb32b892f10ff6 (patch)
tree8382c72940703f1ef70c17e83733e660075ed4ce /tests/unit/dialog
parent3e9e9d58ec47a4cbb917193bb64f6fc6e6fc2cb9 (diff)
downloadjquery-ui-9644e7bae9116edaf8d37c5b38cb32b892f10ff6.tar.gz
jquery-ui-9644e7bae9116edaf8d37c5b38cb32b892f10ff6.zip
Dialog: Escape closeText option before passing it to button
Ref gh-1632 Fixes jquery/api.jqueryui.com#281
Diffstat (limited to 'tests/unit/dialog')
-rw-r--r--tests/unit/dialog/options.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/unit/dialog/options.js b/tests/unit/dialog/options.js
index 6d3a619bd..ab9ace259 100644
--- a/tests/unit/dialog/options.js
+++ b/tests/unit/dialog/options.js
@@ -206,7 +206,7 @@ test( "closeOnEscape", function() {
} );
test( "closeText", function() {
- expect( 3 );
+ expect( 4 );
var element = $( "<div></div>" ).dialog();
equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "Close",
@@ -222,6 +222,11 @@ test( "closeText", function() {
equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "bar",
"closeText via option method" );
element.remove();
+
+ element = $( "<div></div>" ).dialog( { closeText: "<span>foo</span>" } );
+ equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "<span>foo</span>",
+ "closeText is escaped" );
+ element.remove();
} );
test( "draggable", function() {