` to render children in first.
715 |
716 | #### v7.4.2 (unpublished)
717 |
718 | fix: `isMounted` and `(!this.state.isMounted) return
` line #356
719 |
720 | #### v7.4.1
721 |
722 | - fix: Fixed Array.from error in IE11
723 |
724 | #### v7.4.0
725 |
726 | - fix: add `enableUserSelectHack?: boolean;`.
727 |
728 | #### v7.3.1
729 |
730 | - chore(deps): upgrade deps
731 | - chore(deps): upgrade lint and remove unused state
732 | - chore(deps): install prettier
733 |
734 | #### v7.3.0
735 |
736 | - chore(deps): upgrade re-resizable
737 |
738 | #### v7.2.0
739 |
740 | - Support for cancel feature of react-draggable #206
741 |
742 | #### v7.1.5
743 |
744 | - Fixed a issue #199 Add enableUserSelectHack props to react-draggable
745 |
746 | #### v7.1.4
747 |
748 | - Fixed a issue #188 maxWidth and maxHeight props don't respect after resize
749 |
750 | #### v7.1.3
751 |
752 | - Fixed a bug, `extendProps` is not passed correctly.
753 | - Fixed a bug, `bounds` is not work correctly. (#162)
754 |
755 | #### v7.1.1 / v7.1.2
756 |
757 | - Add internal props.
758 |
759 | #### v7.1.0
760 |
761 | - Add `size`.
762 | - Add `position`.
763 |
764 | #### v7.0.0
765 |
766 | - Add `default` instead of `x`, `y`, `width`, `height`.
767 | - Add `resizeHandleWrapperClass` and `resizeHandleWrapperStyle`.
768 |
769 | #### v6.0.1
770 |
771 | - Remove unnecessary types.
772 |
773 | #### v6.0.0
774 |
775 | - Use rollup.
776 | - Support % min/max size.
777 | - Change props, remove `default` and add `x`, `y`, `width`, `height`.
778 | - Rename `dragHandlersXXXX` and `resizeHandlersXXXX` props to `dragHandleXXXX` and `resizeHandleXXXX`.
779 |
780 | #### v5.1.3
781 |
782 | - Fix cursor style, set `normal` to cursor style when `dragHandlerClassName` is not empty.
783 |
784 | #### v5.1.2
785 |
786 | - Add position `relative` when component will update.
787 |
788 | #### v5.1.1
789 |
790 | - Add `top: 0`, `left: 0`.
791 | - Add position `relative` when parent position equals `static`.
792 |
793 | #### v5.1.0
794 |
795 | - Update dependencies(`react-draggable v3`, `flow-bin v0.53`, and other...)
796 |
797 | #### v5.0.9
798 |
799 | - Fix bug new `z` props is not applied to state.
800 |
801 | #### v5.0.8
802 |
803 | - Add `extendsProps`. #129
804 |
805 | #### v5.0.7
806 |
807 | - Add `disableDragging` props.
808 |
809 | #### v5.0.6
810 |
811 | - Fix flow error.
812 |
813 | #### v5.0.5
814 |
815 | - Add index.js.flow
816 |
817 | #### v5.0.4
818 |
819 | - Fix Issue #117.
820 |
821 | #### v5.0.3
822 |
823 | - Fix `updateZIndex`.
824 | - Fix `updateSize`.
825 | - Fix left and top bounds.
826 |
827 | #### v5.0.2
828 |
829 | - Fix argument events #100
830 |
831 | #### v5.0.1
832 |
833 | - Fix example
834 | - Update README
835 |
836 | #### v5.0.0
837 |
838 | - Fix resize bounds.
839 | - Modify API.
840 | - Use original `react-draggable`.
841 |
842 |
843 | #### v4.2.1
844 |
845 | - Added `updateZIndex`, method to updated component `zIndex` state.
846 |
847 | #### v4.2.0
848 |
849 | - Pass the new position in the onResizeStop callback #60
850 |
851 |
852 | #### v4.1.0
853 |
854 | - Pass the new position along in the resize callback #55
855 |
856 |
857 | #### v4.0.1
858 |
859 | - Fix style props to applt zIndex chaned.
860 |
861 | #### v4.0.0
862 |
863 | - Rename `react-rnd`.
864 | - Remove `canUpdatePositionByParent` property.
865 | - Remove `canUpdateSizeByParent` property.
866 | - Remove `initiAsResizing` property.
867 | - Change `x`, `y`, `width` and `height` property to `initial`.
868 | - Add `updateSize`, `updatePosition`, method to updated conponent state.
869 | - Add `lockAspectRatio` property to lock aspect ratio when resizing.
870 |
871 | #### v3.0.0
872 |
873 | - Add `canUpdatePositionByParent` property.
874 |
875 | #### v2.0.0
876 |
877 | - Fix bug, resize and grid not work properly.
878 |
879 | #### v1.2.0
880 |
881 | - Add `grid` props to snap grid. (thanks @paulyoung)
882 | - Fix bug, moveAxis not work properly.
883 |
884 |
885 | #### v1.1.3
886 |
887 | - Fix situations when on dragStop you wanted to revert to 0,0 position #39
888 | - Add `canUpdateSizeByParent` props #38
889 |
890 | #### v1.1.2
891 |
892 | - Add object.assign transform
893 |
894 | #### v1.1.0
895 |
896 | - Add add module exports plugin for `require`
897 |
898 | #### v1.0.1
899 |
900 | - Bug fix
901 |
902 | #### v1.0.0
903 |
904 | - Support react v15.x
905 | - Support left, top resizer
906 | - Remove start props, use width, height, x, and y.
907 |
908 | #### v0.5.3
909 |
910 | - Add handle selector
911 |
912 | ## License
913 |
914 | The MIT License (MIT)
915 |
916 | Copyright (c) 2018 bokuweb
917 |
918 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
919 |
920 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
921 |
922 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
923 |
--------------------------------------------------------------------------------
/src/index.test.tsx:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 |
3 | /* TODO: mask for now
4 | import test from "ava";
5 | import * as React from "react";
6 | import { spy } from "sinon";
7 | import Enzyme, { mount } from "enzyme";
8 | import Adapter from "enzyme-adapter-react-16";
9 | import { Rnd } from "./";
10 |
11 | Enzyme.configure({ adapter: new Adapter() });
12 |
13 | const mouseMove = (x: number, y: number) => {
14 | const event = document.createEvent("MouseEvents");
15 | event.initMouseEvent("mousemove", true, true, window, 0, 0, 0, x, y, false, false, false, false, 0, null);
16 | document.dispatchEvent(event);
17 | return event;
18 | };
19 |
20 | const mouseUp = (x: number, y: number) => {
21 | const event = document.createEvent("MouseEvents");
22 | event.initMouseEvent("mouseup", true, true, window, 0, 0, 0, x, y, false, false, false, false, 0, null);
23 | document.dispatchEvent(event);
24 | return event;
25 | };
26 |
27 | test.beforeEach(async (t) => {
28 | const div = document.createElement("div");
29 | document.body.appendChild(div);
30 | });
31 |
32 | test("should mount without error", async (t) => {
33 | const rnd = mount(
);
34 | t.truthy(!!rnd);
35 | });
36 |
37 | test("Should custom class name be applied to box", async (t) => {
38 | const rnd = mount(
);
39 | t.truthy(rnd.getDOMNode().classList.contains("custom-class-name"));
40 | });
41 |
42 | test("Should render custom components", async (t) => {
43 | const CustomComponent = () =>
;
44 |
45 | const rnd = mount(
46 |
,
50 | right:
,
51 | bottom:
,
52 | left:
,
53 | topRight:
,
54 | bottomRight:
,
55 | bottomLeft:
,
56 | topLeft:
,
57 | }}
58 | />,
59 | );
60 | const customComponents = rnd.find(".custom-component");
61 | t.is(customComponents.length, 8);
62 | });
63 |
64 | test("Should set handler className", async (t) => {
65 | const rnd = mount(
66 |
,
79 | );
80 | const handlers = rnd.find(".handler");
81 | // FIXME: Is it a enzyme 3.x bug ? I can not understand why handlers.length equals 16.
82 | // When use enzyme v2.x this test is passed...
83 | // t.is(handlers.length, 8);
84 | t.is(handlers.length, 16);
85 | });
86 |
87 | test("Should not render resizer when enable props all false", async (t) => {
88 | const rnd = mount(
89 |
,
112 | );
113 | const handlers = rnd.find(".handler");
114 | t.is(handlers.length, 0);
115 | });
116 |
117 | test("should call onMouseDown when mouse downed", async (t) => {
118 | const onMouseDown = spy();
119 | const rnd = mount(
);
120 | rnd.find("div").at(0).simulate("mousedown");
121 | t.is(onMouseDown.callCount, 1);
122 | t.is(onMouseDown.firstCall.args[0].type, "mousedown");
123 | });
124 |
125 | test("should call onDragStart when start dragging", async (t) => {
126 | const onDragStart = spy();
127 | const rnd = mount(
);
128 | rnd.find("div").at(0).simulate("mousedown");
129 | t.is(onDragStart.callCount, 1);
130 | t.is(onDragStart.firstCall.args[0].type, "mousedown");
131 | t.is(onDragStart.firstCall.args[1].x, 200);
132 | t.is(onDragStart.firstCall.args[1].y, 200);
133 | });
134 |
135 | test("should call onDrag when dragging", async (t) => {
136 | const onDrag = spy();
137 | const rnd = mount(
);
138 | rnd.find("div").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
139 | mouseMove(200, 220);
140 | t.is(onDrag.callCount, 1);
141 | t.is(onDrag.firstCall.args[1].x, 500);
142 | t.is(onDrag.firstCall.args[1].y, 520);
143 | t.not((rnd.getDOMNode().getAttribute("style") || "").indexOf("transform: translate(400px, 420px)"), -1);
144 | });
145 |
146 | test("should call onDragStop when drag stop", async (t) => {
147 | const onDragStop = spy();
148 | const rnd = mount(
);
149 | rnd.find("div").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
150 | mouseMove(200, 220);
151 | mouseUp(100, 120);
152 | t.is(onDragStop.callCount, 1);
153 | t.is(onDragStop.firstCall.args[1].x, 200);
154 | t.is(onDragStop.firstCall.args[1].y, 220);
155 | });
156 |
157 | test("should dragging disabled when axis equals none", async (t) => {
158 | const onDrag = spy();
159 | const rnd = mount(
, {
160 | attachTo: document.querySelector("div"),
161 | });
162 | rnd.find("div").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
163 | mouseMove(200, 220);
164 | t.is(onDrag.callCount, 0);
165 | t.not((rnd.getDOMNode().getAttribute("style") || "").indexOf("transform: translate(100px, 100px)"), -1);
166 | });
167 |
168 | test("should enable dragging only x when axis equals x", async (t) => {
169 | const onDrag = spy();
170 | const rnd = mount(
, {
171 | attachTo: document.querySelector("div"),
172 | });
173 | rnd.find("div").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
174 | mouseMove(200, 220);
175 | t.is(onDrag.callCount, 1);
176 | t.not((rnd.getDOMNode().getAttribute("style") || "").indexOf("transform: translate(300px, 100px)"), -1);
177 | });
178 |
179 | test("xdragging only y when axis equals y", async (t) => {
180 | const onDrag = spy();
181 | const rnd = mount(
, {
182 | attachTo: document.querySelector("div"),
183 | });
184 | rnd.find("div").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
185 | mouseMove(200, 220);
186 | t.is(onDrag.callCount, 1);
187 | t.not((rnd.getDOMNode().getAttribute("style") || "").indexOf("transform: translate(100px, 320px)"), -1);
188 | });
189 |
190 | test("should enable dragging both x & y when axis equals both", async (t) => {
191 | const onDrag = spy();
192 | const rnd = mount(
, {
193 | attachTo: document.querySelector("div"),
194 | });
195 | rnd.find("div").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
196 | mouseMove(200, 220);
197 | t.is(onDrag.callCount, 1);
198 | t.not((rnd.getDOMNode().getAttribute("style") || "").indexOf("transform: translate(300px, 320px)"), -1);
199 | });
200 |
201 | test("should snap when dragging smaller than threshold", async (t) => {
202 | const rnd = mount(
, {
203 | attachTo: document.querySelector("div"),
204 | });
205 | rnd.find("div").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
206 | mouseMove(14, 49);
207 | t.not((rnd.getDOMNode().getAttribute("style") || "").indexOf("transform: translate(100px, 100px)"), -1);
208 | });
209 |
210 | test("should snap when dragging larger than threshold", async (t) => {
211 | const rnd = mount(
, {
212 | attachTo: document.querySelector("div"),
213 | });
214 | rnd.find("div").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
215 | mouseMove(15, 50);
216 | t.not((rnd.getDOMNode().getAttribute("style") || "").indexOf("transform: translate(130px, 200px)"), -1);
217 | });
218 |
219 | test("should limit position by parent bounds", async (t) => {
220 | const rnd = mount(
221 |
222 |
223 |
,
224 | { attachTo: document.querySelector("div") },
225 | );
226 | rnd.find("div").at(0).childAt(0).simulate("mousedown", { clientX: 50, clientY: 50 });
227 | mouseMove(1000, 1000);
228 | t.not(
229 | (rnd.find("div").at(0).childAt(0).getDOMNode().getAttribute("style") || "").indexOf(
230 | "transform: translate(700px, 500px)",
231 | ),
232 | -1,
233 | );
234 | });
235 |
236 | test("should limit position by selector bounds", async (t) => {
237 | const rnd = mount(
238 |
,
243 | { attachTo: document.querySelector("div") },
244 | );
245 |
246 | rnd.find("div").at(0).childAt(0).childAt(0).simulate("mousedown", { clientX: 0, clientY: 0 });
247 | mouseMove(2000, 2000);
248 | t.not(
249 | (rnd.find("div").at(0).childAt(0).childAt(0).getDOMNode().getAttribute("style") || "").indexOf(
250 | "translate(900px, 700px)",
251 | ),
252 | -1,
253 | );
254 | });
255 |
256 | test("Should box width and height equal 100px", async (t) => {
257 | const rnd = mount(
258 |
,
271 | { attachTo: document.querySelector("div") },
272 | );
273 | t.is((rnd.getDOMNode() as HTMLElement).style.width, "100px");
274 | t.is((rnd.getDOMNode() as HTMLElement).style.height, "100px");
275 | });
276 |
277 | test("Should call onResizeStart when mousedown", async (t) => {
278 | const onResizeStart = spy();
279 | const rnd = mount(
280 |
,
304 | { attachTo: document.querySelector("div") },
305 | );
306 | rnd.find("div.handler").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
307 | t.is(onResizeStart.callCount, 1);
308 | t.is(onResizeStart.getCall(0).args[1], "right");
309 | });
310 |
311 | test("should call onResize with expected args when resize direction right", async (t) => {
312 | const onResize = spy();
313 | const onResizeStart = spy();
314 | const rnd = mount(
315 |
,
340 | { attachTo: document.querySelector("div") },
341 | );
342 | rnd.find("div.handler").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
343 | mouseMove(200, 220);
344 | t.is(onResize.callCount, 1);
345 | t.truthy(onResize.getCall(0).args[0] instanceof Event);
346 | t.is(onResize.getCall(0).args[1], "right");
347 | t.deepEqual(onResize.getCall(0).args[2].clientWidth, 300);
348 | t.deepEqual(onResize.getCall(0).args[2].clientHeight, 100);
349 | t.deepEqual(onResize.getCall(0).args[3], { width: 200, height: 0 });
350 | });
351 |
352 | test("should call onResizeStop with expected args when resize direction right", async (t) => {
353 | const onResize = spy();
354 | const onResizeStop = spy();
355 | const rnd = mount(
356 |
,
381 | { attachTo: document.querySelector("div") },
382 | );
383 | rnd.find("div.handler").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
384 | mouseMove(200, 220);
385 | mouseUp(200, 220);
386 | t.is(onResizeStop.callCount, 1);
387 | t.truthy(onResize.getCall(0).args[0] instanceof Event);
388 | t.is(onResize.getCall(0).args[1], "right");
389 | t.deepEqual(onResize.getCall(0).args[2].clientWidth, 300);
390 | t.deepEqual(onResize.getCall(0).args[2].clientHeight, 100);
391 | t.deepEqual(onResize.getCall(0).args[3], { width: 200, height: 0 });
392 | });
393 |
394 | test("should move x when resizing left", async (t) => {
395 | const onResize = spy();
396 | const onResizeStart = spy();
397 | const rnd = mount(
398 |
,
423 | { attachTo: document.querySelector("div") },
424 | );
425 | rnd.find("div.handler").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
426 | mouseMove(-50, 0);
427 | t.is(onResize.callCount, 1);
428 | t.is(onResize.getCall(0).args[1], "left");
429 | t.deepEqual(onResize.getCall(0).args[2].clientWidth, 150);
430 | t.deepEqual(onResize.getCall(0).args[2].clientHeight, 100);
431 | t.deepEqual(onResize.getCall(0).args[3], { width: 50, height: 0 });
432 | t.not((rnd.getDOMNode().getAttribute("style") || "").indexOf("transform: translate(50px, 100px)"), -1);
433 | });
434 |
435 | test("should move y when resizing top", async (t) => {
436 | const onResize = spy();
437 | const onResizeStart = spy();
438 | const rnd = mount(
439 |
,
464 | { attachTo: document.querySelector("div") },
465 | );
466 | rnd.find("div.handler").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
467 | mouseMove(0, -50);
468 | t.is(onResize.callCount, 1);
469 | t.is(onResize.getCall(0).args[1], "top");
470 | t.deepEqual(onResize.getCall(0).args[2].clientWidth, 100);
471 | t.deepEqual(onResize.getCall(0).args[2].clientHeight, 150);
472 | t.deepEqual(onResize.getCall(0).args[3], { width: 0, height: 50 });
473 | t.not((rnd.getDOMNode().getAttribute("style") || "").indexOf("transform: translate(100px, 50px)"), -1);
474 | });
475 |
476 | test("should snapped by original grid when x axis resizing smaller then threshold", async (t) => {
477 | const onResize = spy();
478 | const rnd = mount(
479 |
,
504 | { attachTo: document.querySelector("div") },
505 | );
506 | rnd.find("div.handler").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
507 | mouseMove(9, 0);
508 | t.deepEqual(onResize.getCall(0).args[2].clientWidth, 100);
509 | });
510 |
511 | test("should snapped by original grid when x axis resizing larger then threshold", async (t) => {
512 | const onResize = spy();
513 | const rnd = mount(
514 |
,
539 | { attachTo: document.querySelector("div") },
540 | );
541 | rnd.find("div.handler").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
542 | mouseMove(10, 0);
543 | t.deepEqual(onResize.getCall(0).args[2].clientWidth, 120);
544 | });
545 |
546 | test("should snapped by original grid when y axis resizing smaller then threshold", async (t) => {
547 | const onResize = spy();
548 | const rnd = mount(
549 |
,
574 | { attachTo: document.querySelector("div") },
575 | );
576 | rnd.find("div.handler").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
577 | mouseMove(0, 9);
578 | t.deepEqual(onResize.getCall(0).args[2].clientHeight, 100);
579 | });
580 |
581 | test("should snapped by original grid when y axis resizing larger then threshold", async (t) => {
582 | const onResize = spy();
583 | const rnd = mount(
584 |
,
609 | { attachTo: document.querySelector("div") },
610 | );
611 | rnd.find("div.handler").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
612 | mouseMove(0, 10);
613 | t.deepEqual(onResize.getCall(0).args[2].clientHeight, 120);
614 | });
615 |
616 | test("should snapped by original grid when y axis resizing larger then threshold", async (t) => {
617 | const onResize = spy();
618 | const rnd = mount(
619 |
,
644 | { attachTo: document.querySelector("div") },
645 | );
646 | rnd.find("div.handler").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
647 | mouseMove(20, 10);
648 | // TODO: It'a resizable-box grid bug??
649 | t.deepEqual(onResize.getCall(0).args[2].clientWidth, 120);
650 | t.deepEqual(onResize.getCall(0).args[2].clientHeight, 120);
651 | });
652 |
653 | test("should clamped by parent size", async (t) => {
654 | const rnd = mount(
655 |
656 |
680 |
,
681 | { attachTo: document.querySelector("div") },
682 | );
683 | rnd.find("div.handler").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
684 | mouseMove(1200, 1200);
685 | t.is((rnd.childAt(0).getDOMNode() as HTMLElement).style.width, "800px");
686 | t.is((rnd.childAt(0).getDOMNode() as HTMLElement).style.height, "600px");
687 | });
688 |
689 | test("should clamped by selector size", async (t) => {
690 | const rnd = mount(
691 |
,
719 | { attachTo: document.querySelector("div") },
720 | );
721 | rnd.find("div.handler").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
722 | mouseMove(2000, 2000);
723 | t.is((rnd.childAt(0).childAt(0).getDOMNode() as HTMLElement).style.width, "1000px");
724 | t.is((rnd.childAt(0).childAt(0).getDOMNode() as HTMLElement).style.height, "800px");
725 | });
726 |
727 | test("should clamped by boundary element size", async (t) => {
728 | const rnd = mount(
729 |
,
757 | { attachTo: document.querySelector("div") },
758 | );
759 | rnd.find("div.handler").at(0).simulate("mousedown", { clientX: 0, clientY: 0 });
760 | mouseMove(1200, 1200);
761 | t.is((rnd.childAt(0).getDOMNode() as HTMLElement).style.width, "800px");
762 | t.is((rnd.childAt(0).getDOMNode() as HTMLElement).style.height, "600px");
763 | });
764 |
765 | test("should get rnd updated when updatePosition invoked", async (t) => {
766 | const rnd = mount
();
767 | rnd.instance().updatePosition({ x: 200, y: 300 });
768 | t.not((rnd.getDOMNode().getAttribute("style") || "").indexOf("transform: translate(200px, 300px)"), -1);
769 | });
770 |
771 | test("should get rnd updated when updateSize invoked", async (t) => {
772 | const rnd = mount();
773 | rnd.instance().updateSize({ width: 200, height: 300 });
774 | t.is((rnd.getDOMNode() as HTMLElement).style.width, "200px");
775 | t.is((rnd.getDOMNode() as HTMLElement).style.height, "300px");
776 | });
777 |
778 | test("should find drag handle class when dragHandleClassName props passed", async (t) => {
779 | const onDrag = spy();
780 | const rnd = mount(
781 |
782 | Test
783 | ,
784 | );
785 | rnd.find("div.handle").simulate("mousedown", { clientX: 0, clientY: 0 });
786 | mouseMove(200, 220);
787 | t.is(onDrag.callCount, 1);
788 | });
789 |
790 | test("should pass data- attribute", async (t) => {
791 | const rnd = mount(Test);
792 | t.is(!!rnd.find("[data-foo]"), true);
793 | });
794 |
795 | */
796 |
--------------------------------------------------------------------------------