aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-08-27 18:02:11 -0400
committerScott González <scott.gonzalez@gmail.com>2010-08-27 18:02:11 -0400
commit79ee6f0d7b94b71d89f30019e66a1746696d5608 (patch)
treef8d7cdf363a80371ab0463e5b78f6d1c7ae89401 /tests/unit
parentaf9864dcc439bf8d04f4ade248725cc217f66d56 (diff)
downloadjquery-ui-79ee6f0d7b94b71d89f30019e66a1746696d5608.tar.gz
jquery-ui-79ee6f0d7b94b71d89f30019e66a1746696d5608.zip
Dialog: When using the title attribute, update the title option. Fixes #5877 - Dialog: when using the title attribute, the title option should be updated.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/dialog/dialog_options.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js
index fb6a28e12..d20f1d764 100644
--- a/tests/unit/dialog/dialog_options.js
+++ b/tests/unit/dialog/dialog_options.js
@@ -369,7 +369,7 @@ test("stack", function() {
});
test("title", function() {
- expect(5);
+ expect(9);
function titleText() {
return dlg().find(".ui-dialog-title").html();
@@ -377,18 +377,22 @@ test("title", function() {
el = $('<div></div>').dialog();
equals(titleText(), "&nbsp;", "[default]");
+ equals(el.dialog("option", "title"), "", "option not changed");
el.remove();
el = $('<div title="foo"/>').dialog();
equals(titleText(), "foo", "title in element attribute");
+ equals(el.dialog("option", "title"), "foo", "option updated from attribute");
el.remove();
el = $('<div></div>').dialog({ title: 'foo' });
equals(titleText(), "foo", "title in init options");
+ equals(el.dialog("option", "title"), "foo", "opiton set from options hash");
el.remove();
el = $('<div title="foo"/>').dialog({ title: 'bar' });
equals(titleText(), "bar", "title in init options should override title in element attribute");
+ equals(el.dialog("option", "title"), "bar", "opiton set from options hash");
el.remove();
el = $('<div></div>').dialog().dialog('option', 'title', 'foo');