Dialog Tests: Add test to ensure dialog keeps focus when clicking a modal overlay

This commit is contained in:
Kris Borchers 2013-01-30 23:17:45 -06:00
parent d1505e3434
commit e886e4a9c1

View File

@ -355,4 +355,16 @@ test("#5184: isOpen in dialogclose event is true", function() {
el.remove();
});
test("ensure dialog keeps focus when clicking modal overlay", function() {
expect( 2 );
var el = $( "<div></div>" ).dialog({
modal: true
});
ok( $(":focus").closest(".ui-dialog").length, "focus is in dialog" );
$(".ui-widget-overlay").simulate("mousedown");
ok( $(":focus").closest(".ui-dialog").length, "focus is still in dialog" );
el.remove();
});
})(jQuery);