Skip to content

Commit 04825c3

Browse files
committed
Resolve "Failed prop type" warnings in ResizableWithHandle.test.js
Warning: Failed prop type: The prop `children` is marked as required in `ResizableWithHandle`, but its value is `undefined`. at children (/home/chrisroos/Code/rpf/editor-ui/src/utils/ResizableWithHandle.js:42:11)
1 parent 01e7acb commit 04825c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/ResizableWithHandle.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import { render, screen } from "@testing-library/react";
33
import ResizableWithHandle from "./ResizableWithHandle";
44

55
test("renders a horizontal handle", () => {
6-
render(<ResizableWithHandle handleDirection="bottom" />);
6+
render(<ResizableWithHandle handleDirection="bottom"><hr /></ResizableWithHandle>);
77
expect(screen.getByTestId("horizontalHandle")).toBeTruthy();
88
});
99

1010
test("renders a vertical handle", () => {
11-
render(<ResizableWithHandle handleDirection="right" />);
11+
render(<ResizableWithHandle handleDirection="right"><hr /></ResizableWithHandle>);
1212
expect(screen.getByTestId("verticalHandle")).toBeTruthy();
1313
});
1414

1515
test("it does not add an incorrect class to the handle", () => {
1616
const { container } = render(
17-
<ResizableWithHandle handleDirection="bottom" />,
17+
<ResizableWithHandle handleDirection="bottom"><hr /></ResizableWithHandle>,
1818
);
1919
expect(
2020
container.getElementsByClassName("resizable-with-handle__handle--right")
@@ -24,7 +24,7 @@ test("it does not add an incorrect class to the handle", () => {
2424

2525
test("it adds the expected class to the handle", () => {
2626
const { container } = render(
27-
<ResizableWithHandle handleDirection="bottom" />,
27+
<ResizableWithHandle handleDirection="bottom"><hr /></ResizableWithHandle>,
2828
);
2929
expect(
3030
container.getElementsByClassName("resizable-with-handle__handle--bottom")

0 commit comments

Comments
 (0)