diff --git a/lib/DraggableCore.js b/lib/DraggableCore.js index a80eb1b8..996d89dc 100644 --- a/lib/DraggableCore.js +++ b/lib/DraggableCore.js @@ -297,10 +297,6 @@ export default class DraggableCore extends React.Component -
- - ); - - const node = ReactDOM.findDOMNode(drag); + drag = TestUtils.renderIntoDocument( + +
+ + ); - assert(!document.body.classList.contains('react-draggable-transparent-selection')); - TestUtils.Simulate.mouseDown(node, {clientX: 0, clientY: 0}); - assert(document.body.classList.contains('react-draggable-transparent-selection')); - TestUtils.Simulate.mouseUp(node); - assert(!document.body.classList.contains('react-draggable-transparent-selection')); - }); + const node = ReactDOM.findDOMNode(drag); + + assert(!document.body.classList.contains('react-draggable-transparent-selection')); + TestUtils.Simulate.mouseDown(node, {clientX: 0, clientY: 0}); + assert(!document.body.classList.contains('react-draggable-transparent-selection')); + mouseMove(100, 100, node); + assert(document.body.classList.contains('react-draggable-transparent-selection')); + TestUtils.Simulate.mouseUp(node); + assert(!document.body.classList.contains('react-draggable-transparent-selection')); + }); it('should not add and remove transparent selection class when disabled', function () { @@ -493,6 +495,9 @@ describe('react-draggable', function () { assert(!iframeDoc.body.classList.contains('react-draggable-transparent-selection')); TestUtils.Simulate.mouseDown(node, {clientX: 0, clientY: 0}); assert(!document.body.classList.contains('react-draggable-transparent-selection')); + assert(!iframeDoc.body.classList.contains('react-draggable-transparent-selection')); + mouseMove(100, 100, node); + assert(!document.body.classList.contains('react-draggable-transparent-selection')); assert(iframeDoc.body.classList.contains('react-draggable-transparent-selection')); TestUtils.Simulate.mouseUp(node); assert(!document.body.classList.contains('react-draggable-transparent-selection'));