]> source.dussan.org Git - jquery-ui.git/commitdiff
Tests: Fix andenable a couple of unit tests: dialog, tooltip, draggable
authorBrian J. Dowling <bjd-dev@simplicity.net>
Mon, 2 Dec 2013 20:54:29 +0000 (20:54 +0000)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 11 Feb 2014 18:47:29 +0000 (19:47 +0100)
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

Gruntfile.js
tests/unit/dialog/dialog_events.js
tests/unit/dialog/dialog_options.js

index b6a4ca24bdb3f3a2db936f60dc73260914247df9..f20008d4e8ee444205197ab9b1d983d56ebf6c8e 100644 (file)
@@ -171,10 +171,14 @@ grunt.initConfig({
        },
        qunit: {
                files: expandFiles( "tests/unit/**/*.html" ).filter(function( file ) {
-                       // disabling everything that doesn't (quite) work with PhantomJS for now
                        // TODO except for all|index|test, try to include more as we go
-                       return !( /(all|index|test|dialog|tooltip)\.html$/ ).test( file );
-               })
+                       return !( /(all|index|test)\.html$/ ).test( file );
+               }),
+               options: {
+                       page: {
+                               viewportSize: { width: 700, height: 500 }
+                       }
+               }
        },
        jshint: {
                options: {
index 1384500f68e00639d223efbe7a6f65be3fbc8040..2af9990a898328752aa0f706aaadde3491944093 100644 (file)
@@ -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();
 });
 
index 66aeebde0be6365317b47634283c4af8ea1d0b95..87f3553bedc30c6842dce03b12593cfcd35aae70 100644 (file)
@@ -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();
                }