aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorBrian J. Dowling <bjd-dev@simplicity.net>2013-12-02 20:54:29 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2014-02-11 19:47:29 +0100
commit9660b43c01f473da96b76d2d605b9295cefe6f0f (patch)
treea625c04d936ae9d87577e697eab4210f56c9f3ba /tests/unit
parent4c6fce77a701b3b7431f70a2db6391e2779aad97 (diff)
downloadjquery-ui-9660b43c01f473da96b76d2d605b9295cefe6f0f.tar.gz
jquery-ui-9660b43c01f473da96b76d2d605b9295cefe6f0f.zip
Tests: Fix andenable a couple of unit tests: dialog, tooltip, draggable
Some unit tests were disabled in phantomjs. Dialog and draggable depended on a larger viewPort. Tooltip just worked, that was reenabled as well. Closes gh-1173
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/dialog/dialog_events.js4
-rw-r--r--tests/unit/dialog/dialog_options.js2
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit/dialog/dialog_events.js b/tests/unit/dialog/dialog_events.js
index 1384500f6..2af9990a8 100644
--- a/tests/unit/dialog/dialog_events.js
+++ b/tests/unit/dialog/dialog_events.js
@@ -361,9 +361,9 @@ test("ensure dialog keeps focus when clicking modal overlay", function() {
var element = $( "<div></div>" ).dialog({
modal: true
});
- ok( $(":focus").closest(".ui-dialog").length, "focus is in dialog" );
+ equal( $( document.activeElement ).closest( ".ui-dialog" ).length, 1, "focus is in dialog" );
$(".ui-widget-overlay").simulate("mousedown");
- ok( $(":focus").closest(".ui-dialog").length, "focus is still in dialog" );
+ equal( $( document.activeElement ).closest( ".ui-dialog" ).length, 1, "focus is still in dialog" );
element.remove();
});
diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js
index 66aeebde0..87f3553be 100644
--- a/tests/unit/dialog/dialog_options.js
+++ b/tests/unit/dialog/dialog_options.js
@@ -558,7 +558,7 @@ asyncTest( "#4421 - Focus lost from dialog which uses show-effect", function() {
var element = $( "<div></div>" ).dialog({
show: "blind",
focus: function() {
- equal( element.dialog( "widget" ).find( ":focus" ).length, 1, "dialog maintains focus" );
+ equal( element.dialog( "widget" ).find( document.activeElement ).length, 1, "dialog maintains focus" );
element.remove();
start();
}