aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tooltip
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-10-28 20:28:55 -0400
committerScott González <scott.gonzalez@gmail.com>2012-10-28 20:28:55 -0400
commitd074efe5289db4f5182a685046e9b9ad6186ac26 (patch)
treed659301eda82d13ef6edbb63ed2577e96a38716c /tests/unit/tooltip
parent9473ea71866e5eae1c0f242c0b88bb786aa4569b (diff)
downloadjquery-ui-d074efe5289db4f5182a685046e9b9ad6186ac26.tar.gz
jquery-ui-d074efe5289db4f5182a685046e9b9ad6186ac26.zip
Tooltip: Use attributes, not properties, when checking for parent tooltips. Fixes #8742 - Tooltip shows incorrect message in chrome if there is input with name='title' in a form.
Diffstat (limited to 'tests/unit/tooltip')
-rw-r--r--tests/unit/tooltip/tooltip.html4
-rw-r--r--tests/unit/tooltip/tooltip_core.js21
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/unit/tooltip/tooltip.html b/tests/unit/tooltip/tooltip.html
index ca5a1239a..ec616be13 100644
--- a/tests/unit/tooltip/tooltip.html
+++ b/tests/unit/tooltip/tooltip.html
@@ -46,6 +46,10 @@
<span id="contains-tooltipped" title="parent"><span id="contained-tooltipped" title="child">baz</span></span>
</div>
+<form id="tooltip-form">
+ <input name="title" title="attroperties">
+</form>
+
</div>
</body>
</html>
diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js
index 6e9bee208..f0aed72aa 100644
--- a/tests/unit/tooltip/tooltip_core.js
+++ b/tests/unit/tooltip/tooltip_core.js
@@ -73,4 +73,25 @@ test( "nested tooltips", function() {
equal( $( ".ui-tooltip" ).text(), "child" );
});
+// #8742
+test( "form containing an input with name title", function() {
+ expect( 4 );
+
+ var form = $( "#tooltip-form" ).tooltip({
+ show: null,
+ hide: null
+ }),
+ input = form.find( "[name=title]" );
+
+ equal( $( ".ui-tooltip" ).length, 0, "no tooltips on init" );
+
+ input.trigger( "mouseover" );
+ equal( $( ".ui-tooltip" ).length, 1, "tooltip for input" );
+ input.trigger( "mouseleave" );
+ equal( $( ".ui-tooltip" ).length, 0, "tooltip for input closed" );
+
+ form.trigger( "mouseover" );
+ equal( $( ".ui-tooltip" ).length, 0, "no tooltip for form" );
+});
+
}( jQuery ) );