Skip to content

Commit cc1be96

Browse files
committed
add test for static backdrops
1 parent 872ddd5 commit cc1be96

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test/ModalSpec.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ describe('Modal', function () {
9999
ReactTestUtils.Simulate.click(dialog);
100100
});
101101

102+
it('Should not close the modal when the "static" backdrop is clicked', function () {
103+
let onHideSpy = sinon.spy();
104+
let instance = render(
105+
<Modal show onHide={onHideSpy} backdrop='static'>
106+
<strong>Message</strong>
107+
</Modal>
108+
, mountPoint);
109+
110+
let backdrop = React.findDOMNode(instance.refs.backdrop);
111+
112+
ReactTestUtils.Simulate.click(backdrop);
113+
114+
expect(onHideSpy).to.not.have.been.called;
115+
});
116+
102117
it('Should close the modal when the modal close button is clicked', function (done) {
103118
let doneOp = function () { done(); };
104119

0 commit comments

Comments
 (0)