From 86eee400ec6a0ef741e4734c15e254f2e2b0ebb3 Mon Sep 17 00:00:00 2001 From: Nik Nyby Date: Thu, 23 Jun 2016 13:21:10 -0400 Subject: [PATCH 1/2] Add missing comma in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 40e3a540..5eb7882c 100644 --- a/README.md +++ b/README.md @@ -253,7 +253,7 @@ on itself and thus must have callbacks attached to be useful. handle: string, onStart: DraggableEventHandler, onDrag: DraggableEventHandler, - onStop: DraggableEventHandler + onStop: DraggableEventHandler, onMouseDown: (e: MouseEvent) => void } ``` From 549669e2f0eed35c1ecfff60666c03dce2fd34b4 Mon Sep 17 00:00:00 2001 From: Andrew Patton Date: Mon, 18 Jul 2016 13:26:59 -0700 Subject: [PATCH 2/2] :white_check_mark: Fix propType tests latest React React 15.2.0 changed propType validation warning text: https://github.com/facebook/react/blob/master/CHANGELOG.md#1520-july-1-2 016 --- specs/draggable.spec.jsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/specs/draggable.spec.jsx b/specs/draggable.spec.jsx index 7ef79b8b..a0b68a7b 100644 --- a/specs/draggable.spec.jsx +++ b/specs/draggable.spec.jsx @@ -122,7 +122,11 @@ describe('react-draggable', function () { TestUtils.renderIntoDocument(drag); - expect(console.error).toHaveBeenCalledWith('Warning: Failed propType: Invalid prop className passed to Draggable - do not set this, set it on the child.'); + expect( + console.error.calls.argsFor(0)[0].replace('propType:', 'prop type:').split('\n')[0] + ).toBe( + 'Warning: Failed prop type: Invalid prop className passed to Draggable - do not set this, set it on the child.' + ); }); it('should throw when setting style', function () { @@ -130,7 +134,11 @@ describe('react-draggable', function () { TestUtils.renderIntoDocument(drag); - expect(console.error).toHaveBeenCalledWith('Warning: Failed propType: Invalid prop style passed to Draggable - do not set this, set it on the child.'); + expect( + console.error.calls.argsFor(0)[0].replace('propType:', 'prop type:').split('\n')[0] + ).toBe( + 'Warning: Failed prop type: Invalid prop style passed to Draggable - do not set this, set it on the child.' + ); }); it('should throw when setting transform', function () { @@ -138,7 +146,11 @@ describe('react-draggable', function () { TestUtils.renderIntoDocument(drag); - expect(console.error).toHaveBeenCalledWith('Warning: Failed propType: Invalid prop transform passed to Draggable - do not set this, set it on the child.'); + expect( + console.error.calls.argsFor(0)[0].replace('propType:', 'prop type:').split('\n')[0] + ).toBe( + 'Warning: Failed prop type: Invalid prop transform passed to Draggable - do not set this, set it on the child.' + ); }); it('should call onStart when dragging begins', function () {