Skip to content

Commit 9660b43

Browse files
bdowlingjzaefferer
authored andcommitted
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 jquerygh-1173
1 parent 4c6fce7 commit 9660b43

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Gruntfile.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,14 @@ grunt.initConfig({
171171
},
172172
qunit: {
173173
files: expandFiles( "tests/unit/**/*.html" ).filter(function( file ) {
174-
// disabling everything that doesn't (quite) work with PhantomJS for now
175174
// TODO except for all|index|test, try to include more as we go
176-
return !( /(all|index|test|dialog|tooltip)\.html$/ ).test( file );
177-
})
175+
return !( /(all|index|test)\.html$/ ).test( file );
176+
}),
177+
options: {
178+
page: {
179+
viewportSize: { width: 700, height: 500 }
180+
}
181+
}
178182
},
179183
jshint: {
180184
options: {

tests/unit/dialog/dialog_events.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ test("ensure dialog keeps focus when clicking modal overlay", function() {
361361
var element = $( "<div></div>" ).dialog({
362362
modal: true
363363
});
364-
ok( $(":focus").closest(".ui-dialog").length, "focus is in dialog" );
364+
equal( $( document.activeElement ).closest( ".ui-dialog" ).length, 1, "focus is in dialog" );
365365
$(".ui-widget-overlay").simulate("mousedown");
366-
ok( $(":focus").closest(".ui-dialog").length, "focus is still in dialog" );
366+
equal( $( document.activeElement ).closest( ".ui-dialog" ).length, 1, "focus is still in dialog" );
367367
element.remove();
368368
});
369369

tests/unit/dialog/dialog_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ asyncTest( "#4421 - Focus lost from dialog which uses show-effect", function() {
558558
var element = $( "<div></div>" ).dialog({
559559
show: "blind",
560560
focus: function() {
561-
equal( element.dialog( "widget" ).find( ":focus" ).length, 1, "dialog maintains focus" );
561+
equal( element.dialog( "widget" ).find( document.activeElement ).length, 1, "dialog maintains focus" );
562562
element.remove();
563563
start();
564564
}

0 commit comments

Comments
 (0)