diff options
author | Kris Borchers <kris.borchers@gmail.com> | 2013-01-30 23:17:45 -0600 |
---|---|---|
committer | Kris Borchers <kris.borchers@gmail.com> | 2013-01-30 23:44:03 -0600 |
commit | e886e4a9c1a23831f21df0b5a3bf43a01e0ffe1a (patch) | |
tree | 3b1202baaba9c77bd5688cdec1847d238828e901 /tests/unit | |
parent | d1505e3434ef99e0068347a5e8179a0ffd737676 (diff) | |
download | jquery-ui-e886e4a9c1a23831f21df0b5a3bf43a01e0ffe1a.tar.gz jquery-ui-e886e4a9c1a23831f21df0b5a3bf43a01e0ffe1a.zip |
Dialog Tests: Add test to ensure dialog keeps focus when clicking a modal overlay
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/dialog/dialog_events.js | 12 |
1 files changed, 12 insertions, 0 deletions
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 = $( "<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); |