Skip to content

Commit

Permalink
Added test for modal fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lamweili authored Feb 2, 2021
1 parent 0895db5 commit 808bc7e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/modal/test/modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,19 @@ describe('$uibModal', function() {
expect($document).toHaveModalsOpen(0);
});

it('should not close modal when initial click was on slider and mouseup on backdrop', function() {
var selector = 'div.modal-dialog';
open({template: '<div>Content</div>'});

expect($document).toHaveModalsOpen(1);

$document.find(selector).mousedown();
$document.find('body > div.modal').mouseup();
$document.find(selector).click();

expect($document).toHaveModalsOpen(1);
});

it('should return to the element which had focus before the dialog was invoked', function() {
var link = '<a href>Link</a>';
var element = angular.element(link);
Expand Down

0 comments on commit 808bc7e

Please sign in to comment.