You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,37 @@ See https://react-dropzone.netlify.com/#proptypes
92
92
93
93
*Important*: `react-dropzone` doesn't manage dropped files. You need to destroy the object URL yourself whenever you don't need the `preview` by calling `window.URL.revokeObjectURL(file.preview);` to avoid memory leaks.
94
94
95
+
### Testing
96
+
97
+
*Important*: `react-dropzone` makes its drag'n'drop callbacks asynchronous to enable promise based getDataTransfer functions. In order to properly test this, you may want to utilize a helper function to run all promises like this:
exports[`Dropzone basics should render children 1`] =`"<divclass=\\"\\"aria-disabled=\\"false\\"style=\\"position:relative;width:200px;height:200px;border-width:2px;border-color:#666;border-style:dashed;border-radius:5px;\\"><p>somecontent</p><inputtype=\\"file\\"multiple=\\"\\"autocomplete=\\"off\\"style=\\"position:absolute;top:0px;right:0px;bottom:0px;left:0px;opacity:0.00001;pointer-events:none;\\"></div>"`;
exports[`Dropzone basics should render children 1`] =`"<divclass=\\"\\"style=\\"position:relative;width:200px;height:200px;border-width:2px;border-color:#666;border-style:dashed;border-radius:5px;\\"aria-disabled=\\"false\\"><p>somecontent</p><inputtype=\\"file\\"style=\\"position:absolute;top:0px;right:0px;bottom:0px;left:0px;opacity:0.00001;pointer-events:none;\\"multiple=\\"\\"autocomplete=\\"off\\"></div>"`;
0 commit comments