From e886e4a9c1a23831f21df0b5a3bf43a01e0ffe1a Mon Sep 17 00:00:00 2001 From: Kris Borchers Date: Wed, 30 Jan 2013 23:17:45 -0600 Subject: [PATCH] Dialog Tests: Add test to ensure dialog keeps focus when clicking a modal overlay --- tests/unit/dialog/dialog_events.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/unit/dialog/dialog_events.js b/tests/unit/dialog/dialog_events.js index 254158ef4..6de36a8ea 100644 --- a/tests/unit/dialog/dialog_events.js +++ b/tests/unit/dialog/dialog_events.js @@ -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 = $( "
" ).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);