Skip to content

Commit

Permalink
add test for static backdrops
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Jul 31, 2015
1 parent 872ddd5 commit cc1be96
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/ModalSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@ describe('Modal', function () {
ReactTestUtils.Simulate.click(dialog);
});

it('Should not close the modal when the "static" backdrop is clicked', function () {
let onHideSpy = sinon.spy();
let instance = render(
<Modal show onHide={onHideSpy} backdrop='static'>
<strong>Message</strong>
</Modal>
, mountPoint);

let backdrop = React.findDOMNode(instance.refs.backdrop);

ReactTestUtils.Simulate.click(backdrop);

expect(onHideSpy).to.not.have.been.called;
});

it('Should close the modal when the modal close button is clicked', function (done) {
let doneOp = function () { done(); };

Expand Down

0 comments on commit cc1be96

Please sign in to comment.