Skip to content

Commit

Permalink
Tests: Fix andenable a couple of unit tests: dialog, tooltip, draggable
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bdowling authored and jzaefferer committed Feb 11, 2014
1 parent 4c6fce7 commit 9660b43
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions Gruntfile.js
Expand Up @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/dialog/dialog_events.js
Expand Up @@ -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();
});

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/dialog/dialog_options.js
Expand Up @@ -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();
}
Expand Down

0 comments on commit 9660b43

Please sign in to comment.