Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and Re-enable some unit tests on dialog, tooltip, and draggable #1144

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,16 @@ 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|draggable)\.html$/ ).test( file );
})
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)\.html$/ ).test( file );
}),
options: {
page : {
viewportSize : { width: 700, height: 500 }
}
}
},
jshint: {
options: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
"dependencies": {},
"devDependencies": {
"grunt": "0.4.1",
"grunt": "~0.4.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this to "0.4.2"? We like using exact version numbers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, why is this change required?

"grunt-contrib-jshint": "0.7.1",
"grunt-contrib-uglify": "0.1.1",
"grunt-contrib-concat": "0.1.3",
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/dialog/dialog_events.js
Original file line number Diff line number Diff line change
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" );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Styling:
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" );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Styling:
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
Original file line number Diff line number Diff line change
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