diff --git a/package.json b/package.json
index f07705249..e0f95fdaf 100644
--- a/package.json
+++ b/package.json
@@ -67,6 +67,10 @@
"@types/node-fetch": "1.6.9",
"@types/react-test-renderer": "^16.9.0",
"@types/webpack": "^4.41.17",
+ "@testing-library/jest-dom": "^5.9.0",
+ "@testing-library/react": "^10.2.0",
+ "@testing-library/react-hooks": "^3.2.1",
+ "@testing-library/user-event": "^11.0.1",
"chalk": "4.1.0",
"coveralls": "^3.0.6",
"enzyme": "^3.10.0",
@@ -81,8 +85,8 @@
"marked": "^0.7.0",
"node-fetch": "2.6.1",
"raf": "^3.4.0",
- "react": "^15.0.0-0 || ^16.0.0-0",
- "react-dom": "^15.0.0-0 || ^16.0.0-0",
+ "react": "^16.0.0-0 || ^17.0.0-0",
+ "react-dom": "^16.0.0-0 || ^17.0.0-0",
"react-test-renderer": "^16.8.6",
"regenerator-runtime": "^0.10.5",
"timezone-mock": "^1.1.0",
diff --git a/packages/visx-annotation/package.json b/packages/visx-annotation/package.json
index 934dbf111..964e86a11 100644
--- a/packages/visx-annotation/package.json
+++ b/packages/visx-annotation/package.json
@@ -28,7 +28,7 @@
},
"homepage": "https://github.com/airbnb/visx#readme",
"peerDependencies": {
- "react": "^15.0.0-0 || ^16.0.0-0"
+ "react": "^16.0.0-0 || ^17.0.0-0"
},
"dependencies": {
"@types/react": "*",
diff --git a/packages/visx-annotation/test/Annotation.test.tsx b/packages/visx-annotation/test/Annotation.test.tsx
index 6505678fe..e5ce386c0 100644
--- a/packages/visx-annotation/test/Annotation.test.tsx
+++ b/packages/visx-annotation/test/Annotation.test.tsx
@@ -1,4 +1,4 @@
-import { mount } from 'enzyme';
+import { render } from '@testing-library/react';
import React, { useContext } from 'react';
import { Annotation } from '../src';
import AnnotationContext from '../src/context/AnnotationContext';
@@ -16,7 +16,7 @@ describe('', () => {
return null;
}
- mount(
+ render(
,
diff --git a/packages/visx-axis/package.json b/packages/visx-axis/package.json
index ad0e684a9..6580ae7b7 100644
--- a/packages/visx-axis/package.json
+++ b/packages/visx-axis/package.json
@@ -38,7 +38,7 @@
"prop-types": "^15.6.0"
},
"peerDependencies": {
- "react": "^16.3.0-0"
+ "react": "^16.3.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-bounds/package.json b/packages/visx-bounds/package.json
index 07a0e4f4c..21c319e7a 100644
--- a/packages/visx-bounds/package.json
+++ b/packages/visx-bounds/package.json
@@ -35,7 +35,7 @@
"prop-types": "^15.5.10"
},
"peerDependencies": {
- "react": "^15.0.0-0 || ^16.0.0-0",
- "react-dom": "^15.0.0-0 || ^16.0.0-0"
+ "react": "^16.0.0-0 || ^17.0.0-0",
+ "react-dom": "^16.0.0-0 || ^17.0.0-0"
}
}
diff --git a/packages/visx-bounds/test/withBoundingRects.test.tsx b/packages/visx-bounds/test/withBoundingRects.test.tsx
index e3695c4df..57f753625 100644
--- a/packages/visx-bounds/test/withBoundingRects.test.tsx
+++ b/packages/visx-bounds/test/withBoundingRects.test.tsx
@@ -1,37 +1,83 @@
+/* eslint-disable jsx-a11y/no-static-element-interactions */
+/* eslint-disable jsx-a11y/click-events-have-key-events */
import * as React from 'react';
-import { mount } from 'enzyme';
+import { render, waitFor } from '@testing-library/react';
+import fireEvent from '@testing-library/user-event';
import { withBoundingRects } from '../src';
+import '@testing-library/jest-dom';
-const expectedRectShape = expect.objectContaining({
- top: expect.any(Number),
- right: expect.any(Number),
- bottom: expect.any(Number),
- left: expect.any(Number),
- width: expect.any(Number),
- height: expect.any(Number),
-});
+type RectShape = {
+ top?: number;
+ right?: number;
+ bottom?: number;
+ left?: number;
+ width?: number;
+ height?: number;
+};
const emptyRect = {
top: 0,
right: 0,
bottom: 0,
left: 0,
- width: 0,
- height: 0,
};
+const mockRect = {
+ top: 50,
+ left: 50,
+ bottom: 0,
+ right: 0,
+};
+
+type BoundingRectsComponentProps = {
+ rect?: RectShape;
+ parentRect?: RectShape;
+ getRects?: () => DOMRect;
+ children?: JSX.Element;
+ otherProps?: object;
+};
+
+// Component created for testing purpose
+function BoundingRectsComponent({
+ rect,
+ parentRect,
+ getRects,
+ children,
+ ...otherProps
+}: BoundingRectsComponentProps) {
+ const parentRectStyle = {
+ top: parentRect?.top,
+ left: parentRect?.left,
+ bottom: parentRect?.bottom,
+ right: parentRect?.right,
+ };
+
+ const rectStyle = {
+ top: rect?.top,
+ left: rect?.left,
+ bottom: rect?.bottom,
+ right: rect?.right,
+ };
+
+ return (
+
+
getRects?.()}>
+ {children}
+ {JSON.stringify(otherProps)}
+
+
+ );
+}
+
describe('withBoundingRects()', () => {
beforeAll(() => {
// mock getBoundingClientRect
- Element.prototype.getBoundingClientRect = jest.fn(() => ({
- width: 100,
- height: 100,
- top: 0,
- left: 0,
- bottom: 0,
- right: 0,
+ jest.spyOn(Element.prototype, 'getBoundingClientRect').mockImplementation(() => ({
+ ...mockRect,
x: 0,
y: 0,
+ width: 100,
+ height: 100,
toJSON: jest.fn(),
}));
});
@@ -40,41 +86,48 @@ describe('withBoundingRects()', () => {
expect(withBoundingRects).toBeDefined();
});
- test('it should pass rect, parentRect, and getRect props to the wrapped component', () => {
- const Component = () => ;
- const HOC = withBoundingRects(Component);
- const wrapper = mount();
- const RenderedComponent = wrapper.find(Component);
+ test('it should pass rect, parentRect, and getRect props to the wrapped component', async () => {
+ const HOC = withBoundingRects(BoundingRectsComponent);
+ // @ts-ignore
+ const { getByTestId } = render();
+
+ // getBoundingClientRect should be called twice, once for the component, and once for its parent
+ await waitFor(() => expect(Element.prototype.getBoundingClientRect).toHaveBeenCalledTimes(2));
- expect(Element.prototype.getBoundingClientRect).toHaveBeenCalled();
- expect(RenderedComponent.prop('rect')).toEqual(expectedRectShape);
- expect(RenderedComponent.prop('parentRect')).toEqual(expectedRectShape);
- expect(typeof RenderedComponent.prop('getRects')).toBe('function');
+ const RenderedComponent = getByTestId('BoundingRectsComponent');
+ const RenderedComponentParent = getByTestId('BoundingRectsComponentParent');
+
+ const expectedStyle = `top: ${mockRect.top}px; bottom: ${mockRect.bottom}px; left: ${mockRect.left}px; right: ${mockRect.right}px;`;
+ expect(RenderedComponent).toHaveStyle(expectedStyle);
+ expect(RenderedComponentParent).toHaveStyle(expectedStyle);
+
+ fireEvent.click(RenderedComponent);
+ // upon onClick time, getBuondingClientRect should be called extra 2 times
+ expect(Element.prototype.getBoundingClientRect).toHaveBeenCalledTimes(4);
});
test('it should pass additional props to the wrapped component', () => {
- const Component = () => ;
- const HOC = withBoundingRects(Component);
+ const HOC = withBoundingRects(BoundingRectsComponent);
// @ts-ignore
- const wrapper = mount();
- const RenderedComponent = wrapper.find(Component);
- expect(RenderedComponent.prop('bananas')).toBe('are yellow');
+ const { getByText } = render();
+ expect(getByText('are yellow', { exact: false })).toBeInTheDocument();
});
- test('it should return default empty state if no node', () => {
+ test('it should not render if no node', () => {
const Component = () => null;
const HOC = withBoundingRects(Component);
- const wrapper = mount();
- const RenderedComponent = wrapper.find(Component);
- expect(RenderedComponent.prop('rect')).toBeUndefined();
- expect(RenderedComponent.prop('parentRect')).toBeUndefined();
+ const { container } = render();
+ expect(container.innerHTML).toHaveLength(0);
});
test('it should set rect and parentRect to empty state if no getBoundingClient()', () => {
- const Component = () => <>{''}>;
- const HOC = withBoundingRects(Component);
- const wrapper = mount();
- const RenderedComponent = wrapper.find(Component);
- expect(RenderedComponent.prop('rect')).toEqual(emptyRect);
+ (Element.prototype.getBoundingClientRect as unknown) = null;
+ const HOC = withBoundingRects(BoundingRectsComponent);
+ // @ts-ignore
+ const { getByTestId } = render();
+ const RenderedComponent = getByTestId('BoundingRectsComponent');
+ const RenderedComponentParent = getByTestId('BoundingRectsComponentParent');
+ expect(RenderedComponent).toHaveStyle(emptyRect);
+ expect(RenderedComponentParent).toHaveStyle(emptyRect);
});
});
diff --git a/packages/visx-brush/package.json b/packages/visx-brush/package.json
index 8d4bdab5d..aed856b19 100644
--- a/packages/visx-brush/package.json
+++ b/packages/visx-brush/package.json
@@ -30,7 +30,7 @@
"access": "public"
},
"peerDependencies": {
- "react": "^15.0.0-0 || ^16.0.0-0"
+ "react": "^16.0.0-0 || ^17.0.0-0"
},
"dependencies": {
"@visx/drag": "1.18.1",
diff --git a/packages/visx-chord/package.json b/packages/visx-chord/package.json
index 2d2f0237a..815c3e3d0 100644
--- a/packages/visx-chord/package.json
+++ b/packages/visx-chord/package.json
@@ -29,7 +29,7 @@
},
"homepage": "https://github.com/airbnb/visx#readme",
"peerDependencies": {
- "react": "^15.0.0-0 || ^16.0.0-0"
+ "react": "^16.0.0-0 || ^17.0.0-0"
},
"dependencies": {
"@types/d3-chord": "^1.0.9",
diff --git a/packages/visx-clip-path/package.json b/packages/visx-clip-path/package.json
index 8abf69e24..a30141f9a 100644
--- a/packages/visx-clip-path/package.json
+++ b/packages/visx-clip-path/package.json
@@ -33,7 +33,7 @@
"prop-types": "^15.5.10"
},
"peerDependencies": {
- "react": "^15.0.0-0 || ^16.0.0-0"
+ "react": "^16.0.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-demo/package.json b/packages/visx-demo/package.json
index 881865f0e..f8c3b3d45 100644
--- a/packages/visx-demo/package.json
+++ b/packages/visx-demo/package.json
@@ -87,9 +87,9 @@
"nprogress": "^0.2.0",
"prismjs": "^1.19.0",
"raw-loader": "^4.0.0",
- "react": "^16.9.0",
+ "react": "^17.0.0",
"react-docgen-typescript-loader": "3.7.2",
- "react-dom": "^16.9.0",
+ "react-dom": "^17.0.0",
"react-github-button": "^0.1.10",
"react-markdown": "^4.3.1",
"react-spring": "^9.2.0",
diff --git a/packages/visx-demo/src/sandboxes/template/package.json b/packages/visx-demo/src/sandboxes/template/package.json
index ad41f6fea..bcdb06c1f 100644
--- a/packages/visx-demo/src/sandboxes/template/package.json
+++ b/packages/visx-demo/src/sandboxes/template/package.json
@@ -5,11 +5,11 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/responsive": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-annotation/package.json b/packages/visx-demo/src/sandboxes/visx-annotation/package.json
index b8195f5e6..d670f9d84 100644
--- a/packages/visx-demo/src/sandboxes/visx-annotation/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-annotation/package.json
@@ -5,16 +5,16 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/annotation": "latest",
"@visx/mock-data": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
"@visx/shape": "latest",
"d3-array": "^2.8.0",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-area/package.json b/packages/visx-demo/src/sandboxes/visx-area/package.json
index 881b9a4bc..15e947182 100644
--- a/packages/visx-demo/src/sandboxes/visx-area/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-area/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/curve": "latest",
"@visx/event": "latest",
"@visx/gradient": "latest",
@@ -18,8 +18,8 @@
"@visx/tooltip": "latest",
"d3-array": "^2.4.0",
"d3-time-format": "2.2.3",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-axis/package.json b/packages/visx-demo/src/sandboxes/visx-axis/package.json
index 357b50c3e..a36544ad9 100644
--- a/packages/visx-demo/src/sandboxes/visx-axis/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-axis/package.json
@@ -6,8 +6,8 @@
"dependencies": {
"@babel/runtime": "^7.8.4",
"@types/d3-time-format": "2.1.1",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/axis": "latest",
"@visx/curve": "latest",
"@visx/gradient": "latest",
@@ -19,8 +19,8 @@
"@visx/shape": "latest",
"@visx/scale": "latest",
"d3-time-format": "^2.2.3",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"react-spring": "^9.2.0",
"typescript": "^3"
diff --git a/packages/visx-demo/src/sandboxes/visx-bargroup-horizontal/package.json b/packages/visx-demo/src/sandboxes/visx-bargroup-horizontal/package.json
index b6b868cef..b246a4fc8 100644
--- a/packages/visx-demo/src/sandboxes/visx-bargroup-horizontal/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-bargroup-horizontal/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/axis": "latest",
"@visx/group": "latest",
"@visx/mock-data": "latest",
@@ -14,8 +14,8 @@
"@visx/scale": "latest",
"@visx/shape": "latest",
"d3-time-format": "^2.2.3",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-bargroup/package.json b/packages/visx-demo/src/sandboxes/visx-bargroup/package.json
index e776f11a6..df4f4f562 100644
--- a/packages/visx-demo/src/sandboxes/visx-bargroup/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-bargroup/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/axis": "latest",
"@visx/group": "latest",
"@visx/mock-data": "latest",
@@ -14,8 +14,8 @@
"@visx/scale": "latest",
"@visx/shape": "latest",
"d3-time-format": "^2.2.3",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-bars/package.json b/packages/visx-demo/src/sandboxes/visx-bars/package.json
index 24734e539..2b595f12b 100644
--- a/packages/visx-demo/src/sandboxes/visx-bars/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-bars/package.json
@@ -5,16 +5,16 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/gradient": "latest",
"@visx/group": "latest",
"@visx/mock-data": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
"@visx/shape": "latest",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-barstack-horizontal/package.json b/packages/visx-demo/src/sandboxes/visx-barstack-horizontal/package.json
index 16fb8b40c..ad79d8b52 100644
--- a/packages/visx-demo/src/sandboxes/visx-barstack-horizontal/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-barstack-horizontal/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/axis": "latest",
"@visx/grid": "latest",
"@visx/group": "latest",
@@ -17,8 +17,8 @@
"@visx/shape": "latest",
"@visx/tooltip": "latest",
"d3-time-format": "2.2.3",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-barstack/package.json b/packages/visx-demo/src/sandboxes/visx-barstack/package.json
index c234baa91..e8d3c292b 100644
--- a/packages/visx-demo/src/sandboxes/visx-barstack/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-barstack/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/axis": "latest",
"@visx/event": "latest",
"@visx/grid": "latest",
@@ -18,8 +18,8 @@
"@visx/shape": "latest",
"@visx/tooltip": "latest",
"d3-time-format": "2.2.3",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-brush/package.json b/packages/visx-demo/src/sandboxes/visx-brush/package.json
index 91bb574ab..7ca6f930f 100644
--- a/packages/visx-demo/src/sandboxes/visx-brush/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-brush/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/axis": "latest",
"@visx/brush": "latest",
"@visx/curve": "latest",
@@ -18,8 +18,8 @@
"@visx/scale": "latest",
"@visx/shape": "latest",
"d3-array": "^2.4.0",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-chord/package.json b/packages/visx-demo/src/sandboxes/visx-chord/package.json
index cd412345f..0498ab8d6 100644
--- a/packages/visx-demo/src/sandboxes/visx-chord/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-chord/package.json
@@ -5,16 +5,16 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/chord": "latest",
"@visx/gradient": "latest",
"@visx/group": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
"@visx/shape": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-curve/package.json b/packages/visx-demo/src/sandboxes/visx-curve/package.json
index c45a5839f..56783281f 100644
--- a/packages/visx-demo/src/sandboxes/visx-curve/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-curve/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/curve": "latest",
"@visx/gradient": "latest",
"@visx/group": "latest",
@@ -16,8 +16,8 @@
"@visx/scale": "latest",
"@visx/shape": "latest",
"d3-array": "^2.4.0",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-dendrogram/package.json b/packages/visx-demo/src/sandboxes/visx-dendrogram/package.json
index bb19003c5..c3ca86171 100644
--- a/packages/visx-demo/src/sandboxes/visx-dendrogram/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-dendrogram/package.json
@@ -5,15 +5,15 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/gradient": "latest",
"@visx/group": "latest",
"@visx/hierarchy": "latest",
"@visx/responsive": "latest",
"@visx/shape": "latest",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-dots/package.json b/packages/visx-demo/src/sandboxes/visx-dots/package.json
index 3ee829eb8..8cf1b038d 100644
--- a/packages/visx-demo/src/sandboxes/visx-dots/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-dots/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/event": "latest",
"@visx/gradient": "latest",
"@visx/group": "latest",
@@ -16,8 +16,8 @@
"@visx/shape": "latest",
"@visx/tooltip": "latest",
"@visx/voronoi": "latest",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-drag-i/package.json b/packages/visx-demo/src/sandboxes/visx-drag-i/package.json
index fd4e951e4..85aa33e5e 100644
--- a/packages/visx-demo/src/sandboxes/visx-drag-i/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-drag-i/package.json
@@ -5,15 +5,15 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/drag": "latest",
"@visx/gradient": "latest",
"@visx/mock-data": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-drag-ii/package.json b/packages/visx-demo/src/sandboxes/visx-drag-ii/package.json
index e65f62f8a..08dc30e44 100644
--- a/packages/visx-demo/src/sandboxes/visx-drag-ii/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-drag-ii/package.json
@@ -5,15 +5,15 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/curve": "latest",
"@visx/drag": "latest",
"@visx/gradient": "latest",
"@visx/responsive": "latest",
"@visx/shape": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-geo-albers-usa/package.json b/packages/visx-demo/src/sandboxes/visx-geo-albers-usa/package.json
index 8adf87bc1..5279cba06 100644
--- a/packages/visx-demo/src/sandboxes/visx-geo-albers-usa/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-geo-albers-usa/package.json
@@ -5,13 +5,13 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/geo": "latest",
"@visx/responsive": "latest",
"d3-geo": "^3.0.1",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"topojson-client": "^3.1.0",
"typescript": "^3"
diff --git a/packages/visx-demo/src/sandboxes/visx-geo-custom/package.json b/packages/visx-demo/src/sandboxes/visx-geo-custom/package.json
index 39cbe2fed..9b3578de4 100644
--- a/packages/visx-demo/src/sandboxes/visx-geo-custom/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-geo-custom/package.json
@@ -5,15 +5,15 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/geo": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
"@visx/zoom": "latest",
"d3-geo": "^1.11.9",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"topojson-client": "3.1.0",
"typescript": "^3"
diff --git a/packages/visx-demo/src/sandboxes/visx-geo-mercator/package.json b/packages/visx-demo/src/sandboxes/visx-geo-mercator/package.json
index 3edc99518..82f8a1a28 100644
--- a/packages/visx-demo/src/sandboxes/visx-geo-mercator/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-geo-mercator/package.json
@@ -5,13 +5,13 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/geo": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"topojson-client": "^3.1.0",
"typescript": "^3"
diff --git a/packages/visx-demo/src/sandboxes/visx-glyph/package.json b/packages/visx-demo/src/sandboxes/visx-glyph/package.json
index 5160acc7a..6a2158cf7 100644
--- a/packages/visx-demo/src/sandboxes/visx-glyph/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-glyph/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/curve": "latest",
"@visx/glyph": "latest",
"@visx/group": "latest",
@@ -14,8 +14,8 @@
"@visx/responsive": "latest",
"@visx/scale": "latest",
"@visx/shape": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-gradient/package.json b/packages/visx-demo/src/sandboxes/visx-gradient/package.json
index bff8a3f3f..59eb2a56b 100644
--- a/packages/visx-demo/src/sandboxes/visx-gradient/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-gradient/package.json
@@ -5,13 +5,13 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/gradient": "latest",
"@visx/responsive": "latest",
"@visx/shape": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-heatmap/package.json b/packages/visx-demo/src/sandboxes/visx-heatmap/package.json
index a9a4e203a..0260ab619 100644
--- a/packages/visx-demo/src/sandboxes/visx-heatmap/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-heatmap/package.json
@@ -5,16 +5,15 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/group": "latest",
"@visx/heatmap": "latest",
"@visx/mock-data": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
-
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-legend/package.json b/packages/visx-demo/src/sandboxes/visx-legend/package.json
index 6b23b0094..0881f936a 100644
--- a/packages/visx-demo/src/sandboxes/visx-legend/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-legend/package.json
@@ -5,14 +5,14 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/glyph": "latest",
"@visx/legend": "latest",
"@visx/scale": "latest",
"d3-format": "^1.4.4",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-linktypes/package.json b/packages/visx-demo/src/sandboxes/visx-linktypes/package.json
index 84695ed11..d774bf25d 100644
--- a/packages/visx-demo/src/sandboxes/visx-linktypes/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-linktypes/package.json
@@ -5,16 +5,16 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/gradient": "latest",
"@visx/group": "latest",
"@visx/hierarchy": "latest",
"@visx/responsive": "latest",
"@visx/shape": "latest",
"d3-shape": "1.3.7",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-network/package.json b/packages/visx-demo/src/sandboxes/visx-network/package.json
index 8c99d4073..1b7424cb5 100644
--- a/packages/visx-demo/src/sandboxes/visx-network/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-network/package.json
@@ -5,12 +5,12 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/responsive": "latest",
"@visx/network": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-pack/package.json b/packages/visx-demo/src/sandboxes/visx-pack/package.json
index 57567b77c..ab486708d 100644
--- a/packages/visx-demo/src/sandboxes/visx-pack/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-pack/package.json
@@ -5,15 +5,15 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/group": "latest",
"@visx/hierarchy": "latest",
"@visx/mock-data": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-pattern/package.json b/packages/visx-demo/src/sandboxes/visx-pattern/package.json
index f928c7365..21ea0d067 100644
--- a/packages/visx-demo/src/sandboxes/visx-pattern/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-pattern/package.json
@@ -5,14 +5,14 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/group": "latest",
"@visx/pattern": "latest",
"@visx/responsive": "latest",
"@visx/shape": "latest",
- "react": "^16.2",
- "react-dom": "^16.2",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-polygons/package.json b/packages/visx-demo/src/sandboxes/visx-polygons/package.json
index f2e28393f..6c6368eeb 100644
--- a/packages/visx-demo/src/sandboxes/visx-polygons/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-polygons/package.json
@@ -5,15 +5,15 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/gradient": "latest",
"@visx/group": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
"@visx/shape": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-radar/package.json b/packages/visx-demo/src/sandboxes/visx-radar/package.json
index 4c3271cef..79a78a30d 100644
--- a/packages/visx-demo/src/sandboxes/visx-radar/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-radar/package.json
@@ -5,16 +5,16 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/group": "latest",
"@visx/mock-data": "latest",
"@visx/responsive": "latest",
"@visx/point": "latest",
"@visx/scale": "latest",
"@visx/shape": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-responsive/package.json b/packages/visx-demo/src/sandboxes/visx-responsive/package.json
index 07c470246..52fa53210 100644
--- a/packages/visx-demo/src/sandboxes/visx-responsive/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-responsive/package.json
@@ -6,16 +6,16 @@
"dependencies": {
"@babel/runtime": "^7.8.4",
"@types/d3-array": "^2.0.0",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/group": "latest",
"@visx/mock-data": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
"@visx/shape": "latest",
"d3-array": "^2.4.0",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-shape-line-radial/package.json b/packages/visx-demo/src/sandboxes/visx-shape-line-radial/package.json
index d6c84adbf..2f5a9fb59 100644
--- a/packages/visx-demo/src/sandboxes/visx-shape-line-radial/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-shape-line-radial/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/axis": "latest",
"@visx/curve": "latest",
"@visx/gradient": "latest",
@@ -16,8 +16,8 @@
"@visx/responsive": "latest",
"@visx/scale": "latest",
"@visx/shape": "latest",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"react-spring": "^9.2.0",
"typescript": "^3"
diff --git a/packages/visx-demo/src/sandboxes/visx-shape-pie/package.json b/packages/visx-demo/src/sandboxes/visx-shape-pie/package.json
index c1a4c9384..a7b5bfad4 100644
--- a/packages/visx-demo/src/sandboxes/visx-shape-pie/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-shape-pie/package.json
@@ -5,16 +5,16 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/gradient": "latest",
"@visx/group": "latest",
"@visx/mock-data": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
"@visx/shape": "latest",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"react-spring": "^9.2.0",
"typescript": "^3"
diff --git a/packages/visx-demo/src/sandboxes/visx-shape-splitlinepath/package.json b/packages/visx-demo/src/sandboxes/visx-shape-splitlinepath/package.json
index f5b623e99..8d793cf72 100644
--- a/packages/visx-demo/src/sandboxes/visx-shape-splitlinepath/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-shape-splitlinepath/package.json
@@ -5,16 +5,16 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/curve": "latest",
"@visx/gradient": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
"@visx/shape": "latest",
"lodash": "^4.17.21",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-stacked-areas/package.json b/packages/visx-demo/src/sandboxes/visx-stacked-areas/package.json
index f3015728f..fe891d6a9 100644
--- a/packages/visx-demo/src/sandboxes/visx-stacked-areas/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-stacked-areas/package.json
@@ -5,16 +5,16 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/gradient": "latest",
"@visx/mock-data": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
"@visx/shape": "latest",
"d3-time-format": "2.2.3",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-stats/package.json b/packages/visx-demo/src/sandboxes/visx-stats/package.json
index 012d069ea..d4db594f9 100644
--- a/packages/visx-demo/src/sandboxes/visx-stats/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-stats/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/gradient": "latest",
"@visx/group": "latest",
"@visx/mock-data": "latest",
@@ -15,8 +15,8 @@
"@visx/scale": "latest",
"@visx/stats": "latest",
"@visx/tooltip": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-streamgraph/package.json b/packages/visx-demo/src/sandboxes/visx-streamgraph/package.json
index 7dbe81298..bb3002f3b 100644
--- a/packages/visx-demo/src/sandboxes/visx-streamgraph/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-streamgraph/package.json
@@ -6,16 +6,16 @@
"dependencies": {
"@babel/runtime": "^7.8.4",
"@types/d3-array": "^2.0.0",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/mock-data": "latest",
"@visx/pattern": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
"@visx/shape": "latest",
"d3-array": "^2.4.0",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"react-spring": "^9.2.0",
"typescript": "^3"
diff --git a/packages/visx-demo/src/sandboxes/visx-threshold/package.json b/packages/visx-demo/src/sandboxes/visx-threshold/package.json
index 76cd0d853..d78b28fa6 100644
--- a/packages/visx-demo/src/sandboxes/visx-threshold/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-threshold/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/axis": "latest",
"@visx/curve": "latest",
"@visx/grid": "latest",
@@ -16,8 +16,8 @@
"@visx/scale": "latest",
"@visx/shape": "latest",
"@visx/threshold": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-tooltip/package.json b/packages/visx-demo/src/sandboxes/visx-tooltip/package.json
index 038c07f51..a8fb55ce8 100644
--- a/packages/visx-demo/src/sandboxes/visx-tooltip/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-tooltip/package.json
@@ -5,12 +5,12 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/responsive": "latest",
"@visx/tooltip": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-tree/package.json b/packages/visx-demo/src/sandboxes/visx-tree/package.json
index ce0866565..05bf9d8fa 100644
--- a/packages/visx-demo/src/sandboxes/visx-tree/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-tree/package.json
@@ -5,15 +5,15 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/gradient": "latest",
"@visx/group": "latest",
"@visx/hierarchy": "latest",
"@visx/responsive": "latest",
"@visx/shape": "latest",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-treemap/package.json b/packages/visx-demo/src/sandboxes/visx-treemap/package.json
index 086a729cf..f56594ca8 100644
--- a/packages/visx-demo/src/sandboxes/visx-treemap/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-treemap/package.json
@@ -5,15 +5,15 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/group": "latest",
"@visx/hierarchy": "latest",
"@visx/mock-data": "latest",
"@visx/responsive": "latest",
"@visx/scale": "latest",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-voronoi/package.json b/packages/visx-demo/src/sandboxes/visx-voronoi/package.json
index 05baae42c..bea848d64 100644
--- a/packages/visx-demo/src/sandboxes/visx-voronoi/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-voronoi/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/clip-path": "latest",
"@visx/event": "latest",
"@visx/gradient": "latest",
@@ -14,8 +14,8 @@
"@visx/mock-data": "latest",
"@visx/responsive": "latest",
"@visx/voronoi": "latest",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-demo/src/sandboxes/visx-xychart/package.json b/packages/visx-demo/src/sandboxes/visx-xychart/package.json
index 961066f82..8cf43ddc9 100644
--- a/packages/visx-demo/src/sandboxes/visx-xychart/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-xychart/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/curve": "1.0.0",
"@visx/glyph": "latest",
"@visx/mock-data": "latest",
@@ -14,8 +14,8 @@
"@visx/react-spring": "latest",
"@visx/responsive": "latest",
"@visx/xychart": "latest",
- "react": "^16",
- "react-dom": "^16",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"react-spring": "^9.2.0",
"typescript": "^3"
diff --git a/packages/visx-demo/src/sandboxes/visx-zoom-i/package.json b/packages/visx-demo/src/sandboxes/visx-zoom-i/package.json
index d7274a9c3..0d3333ecf 100644
--- a/packages/visx-demo/src/sandboxes/visx-zoom-i/package.json
+++ b/packages/visx-demo/src/sandboxes/visx-zoom-i/package.json
@@ -5,8 +5,8 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.8.4",
- "@types/react": "^16",
- "@types/react-dom": "^16",
+ "@types/react": "^17",
+ "@types/react-dom": "^17",
"@visx/clip-path": "latest",
"@visx/event": "latest",
"@visx/mock-data": "latest",
@@ -14,8 +14,8 @@
"@visx/scale": "latest",
"@visx/zoom": "latest",
"d3-scale-chromatic": "^1.5.0",
- "react": "^16.8",
- "react-dom": "^16.8",
+ "react": "^17",
+ "react-dom": "^17",
"react-scripts-ts": "3.1.0",
"typescript": "^3"
},
diff --git a/packages/visx-drag/package.json b/packages/visx-drag/package.json
index a3e29e6f0..7e4cd328c 100644
--- a/packages/visx-drag/package.json
+++ b/packages/visx-drag/package.json
@@ -31,7 +31,7 @@
"access": "public"
},
"peerDependencies": {
- "react": "^16.8.0-0"
+ "react": "^16.8.0-0 || ^17.0.0-0"
},
"dependencies": {
"@types/react": "*",
diff --git a/packages/visx-drag/test/useDrag.test.tsx b/packages/visx-drag/test/useDrag.test.tsx
index 7d4996c7e..5cd7b8295 100644
--- a/packages/visx-drag/test/useDrag.test.tsx
+++ b/packages/visx-drag/test/useDrag.test.tsx
@@ -1,5 +1,5 @@
import React, { useRef } from 'react';
-import { mount } from 'enzyme';
+import { render } from '@testing-library/react';
import { useDrag } from '../src';
import { UseDragOptions } from '../lib/useDrag';
@@ -26,7 +26,7 @@ describe('useDrag', () => {
return null;
}
- mount();
+ render();
});
test('should update drag state when useDrag options change', () => {
@@ -46,7 +46,7 @@ describe('useDrag', () => {
return null;
}
- const wrapper = mount();
- wrapper.setProps(options2);
+ const { rerender } = render();
+ rerender();
});
});
diff --git a/packages/visx-geo/package.json b/packages/visx-geo/package.json
index bff9d8991..8258e3007 100644
--- a/packages/visx-geo/package.json
+++ b/packages/visx-geo/package.json
@@ -42,7 +42,7 @@
"topojson-client": "^3.0.0"
},
"peerDependencies": {
- "react": "^16.3.0-0"
+ "react": "^16.3.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-glyph/package.json b/packages/visx-glyph/package.json
index ee362df96..230c87e9b 100644
--- a/packages/visx-glyph/package.json
+++ b/packages/visx-glyph/package.json
@@ -31,7 +31,7 @@
"access": "public"
},
"peerDependencies": {
- "react": "^16.3.0-0"
+ "react": "^16.3.0-0 || ^17.0.0-0"
},
"dependencies": {
"@types/d3-shape": "^1.3.1",
diff --git a/packages/visx-glyph/test/Cross.test.tsx b/packages/visx-glyph/test/Cross.test.tsx
index c8accd2e2..55ec1e72a 100644
--- a/packages/visx-glyph/test/Cross.test.tsx
+++ b/packages/visx-glyph/test/Cross.test.tsx
@@ -29,7 +29,7 @@ describe('', () => {
shallow({fn});
const args = fn.mock.calls[0][0];
const keys = Object.keys(args);
- expect(keys.includes('path')).toEqual(true);
+ expect(keys).toContain('path');
});
test('it should take a size prop as a number', () => {
diff --git a/packages/visx-gradient/package.json b/packages/visx-gradient/package.json
index a93d00e02..4f80587fd 100644
--- a/packages/visx-gradient/package.json
+++ b/packages/visx-gradient/package.json
@@ -32,7 +32,7 @@
"prop-types": "^15.5.7"
},
"peerDependencies": {
- "react": "^15.0.0-0 || ^16.0.0-0"
+ "react": "^16.0.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-gradient/test/Gradients.test.tsx b/packages/visx-gradient/test/Gradients.test.tsx
index e16e1dbce..74524587f 100644
--- a/packages/visx-gradient/test/Gradients.test.tsx
+++ b/packages/visx-gradient/test/Gradients.test.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { mount } from 'enzyme';
+import { render } from '@testing-library/react';
import {
GradientDarkgreenGreen,
@@ -21,7 +21,7 @@ describe('', () => {
test('it should render without crashing', () => {
expect(() =>
- mount(
+ render(
,
@@ -37,7 +37,7 @@ describe('', () => {
test('it should render without crashing', () => {
expect(() =>
- mount(
+ render(
,
@@ -53,7 +53,7 @@ describe('', () => {
test('it should render without crashing', () => {
expect(() =>
- mount(
+ render(
,
@@ -69,7 +69,7 @@ describe('', () => {
test('it should render without crashing', () => {
expect(() =>
- mount(
+ render(
,
@@ -85,7 +85,7 @@ describe('', () => {
test('it should render without crashing', () => {
expect(() =>
- mount(
+ render(
,
@@ -101,7 +101,7 @@ describe('', () => {
test('it should render without crashing', () => {
expect(() =>
- mount(
+ render(
,
@@ -117,7 +117,7 @@ describe('', () => {
test('it should render without crashing', () => {
expect(() =>
- mount(
+ render(
,
@@ -133,7 +133,7 @@ describe('', () => {
test('it should render without crashing', () => {
expect(() =>
- mount(
+ render(
,
@@ -149,7 +149,7 @@ describe('', () => {
test('it should render without crashing', () => {
expect(() =>
- mount(
+ render(
,
@@ -165,7 +165,7 @@ describe('', () => {
test('it should render without crashing', () => {
expect(() =>
- mount(
+ render(
,
diff --git a/packages/visx-gradient/test/LinearGradient.test.tsx b/packages/visx-gradient/test/LinearGradient.test.tsx
index f5eae333c..8d9f055f6 100644
--- a/packages/visx-gradient/test/LinearGradient.test.tsx
+++ b/packages/visx-gradient/test/LinearGradient.test.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { mount } from 'enzyme';
+import { render } from '@testing-library/react';
import { LinearGradient } from '../src';
@@ -10,7 +10,7 @@ describe('', () => {
test('it should render without crashing', () => {
expect(() =>
- mount(
+ render(
,
diff --git a/packages/visx-gradient/test/RadialGradient.test.tsx b/packages/visx-gradient/test/RadialGradient.test.tsx
index d0529c688..660e6d6d3 100644
--- a/packages/visx-gradient/test/RadialGradient.test.tsx
+++ b/packages/visx-gradient/test/RadialGradient.test.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { mount } from 'enzyme';
+import { render } from '@testing-library/react';
import { RadialGradient } from '../src';
@@ -10,7 +10,7 @@ describe('', () => {
test('it should render without crashing', () => {
expect(() =>
- mount(
+ render(
,
diff --git a/packages/visx-grid/package.json b/packages/visx-grid/package.json
index 5c64d4328..0589638da 100644
--- a/packages/visx-grid/package.json
+++ b/packages/visx-grid/package.json
@@ -28,7 +28,7 @@
},
"homepage": "https://github.com/airbnb/visx#readme",
"peerDependencies": {
- "react": "^15.0.0-0 || ^16.0.0-0"
+ "react": "^16.0.0-0 || ^17.0.0-0"
},
"dependencies": {
"@types/react": "*",
diff --git a/packages/visx-grid/test/GridPolar.test.tsx b/packages/visx-grid/test/GridPolar.test.tsx
index 130e4d166..6aaccbdc8 100644
--- a/packages/visx-grid/test/GridPolar.test.tsx
+++ b/packages/visx-grid/test/GridPolar.test.tsx
@@ -1,8 +1,8 @@
import React from 'react';
import { shallow } from 'enzyme';
+import { scaleLinear } from '@visx/scale';
import { GridPolar, GridAngle, GridRadial } from '../src';
-import { scaleLinear } from '../../visx-scale';
const gridProps = {
innerRadius: 0,
diff --git a/packages/visx-grid/test/GridRadial.test.tsx b/packages/visx-grid/test/GridRadial.test.tsx
index 7f08545d8..24aada1db 100644
--- a/packages/visx-grid/test/GridRadial.test.tsx
+++ b/packages/visx-grid/test/GridRadial.test.tsx
@@ -2,8 +2,8 @@ import React from 'react';
import { shallow } from 'enzyme';
import { Arc } from '@visx/shape';
+import { scaleLinear } from '@visx/scale';
import { GridRadial } from '../src';
-import { scaleLinear } from '../../visx-scale';
const gridProps = {
innerRadius: 0,
diff --git a/packages/visx-group/package.json b/packages/visx-group/package.json
index 530fb8cdd..96baab693 100644
--- a/packages/visx-group/package.json
+++ b/packages/visx-group/package.json
@@ -29,7 +29,7 @@
},
"homepage": "https://github.com/airbnb/visx#readme",
"peerDependencies": {
- "react": "^15.0.0-0 || ^16.0.0-0"
+ "react": "^16.0.0-0 || ^17.0.0-0"
},
"dependencies": {
"@types/react": "*",
diff --git a/packages/visx-heatmap/package.json b/packages/visx-heatmap/package.json
index ea8ea3507..6bc159417 100644
--- a/packages/visx-heatmap/package.json
+++ b/packages/visx-heatmap/package.json
@@ -31,7 +31,7 @@
"access": "public"
},
"peerDependencies": {
- "react": "^16.3.0-0"
+ "react": "^16.3.0-0 || ^17.0.0-0"
},
"dependencies": {
"@types/react": "*",
diff --git a/packages/visx-hierarchy/package.json b/packages/visx-hierarchy/package.json
index 916a89b08..9c8d7103e 100644
--- a/packages/visx-hierarchy/package.json
+++ b/packages/visx-hierarchy/package.json
@@ -39,6 +39,6 @@
"prop-types": "^15.6.1"
},
"peerDependencies": {
- "react": "^16.3.0-0"
+ "react": "^16.3.0-0 || ^17.0.0-0"
}
}
diff --git a/packages/visx-legend/package.json b/packages/visx-legend/package.json
index 71de11a4b..2a9af8e0f 100644
--- a/packages/visx-legend/package.json
+++ b/packages/visx-legend/package.json
@@ -28,7 +28,7 @@
},
"homepage": "https://github.com/airbnb/visx#readme",
"peerDependencies": {
- "react": "^16.3.0-0"
+ "react": "^16.3.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-marker/package.json b/packages/visx-marker/package.json
index 4822e7fff..8a21c3e9d 100644
--- a/packages/visx-marker/package.json
+++ b/packages/visx-marker/package.json
@@ -35,7 +35,7 @@
"prop-types": "^15.6.2"
},
"peerDependencies": {
- "react": "^15.0.0-0 || ^16.0.0-0"
+ "react": "^16.0.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-network/package.json b/packages/visx-network/package.json
index 94e22cfcb..0a2567525 100644
--- a/packages/visx-network/package.json
+++ b/packages/visx-network/package.json
@@ -26,7 +26,7 @@
"prop-types": "^15.6.2"
},
"peerDependencies": {
- "react": "^16.3.0-0"
+ "react": "^16.3.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-pattern/package.json b/packages/visx-pattern/package.json
index ec7a5eccd..74f7818a8 100644
--- a/packages/visx-pattern/package.json
+++ b/packages/visx-pattern/package.json
@@ -33,7 +33,7 @@
"prop-types": "^15.5.10"
},
"peerDependencies": {
- "react": "^15.0.0-0 || ^16.0.0-0"
+ "react": "^16.0.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-react-spring/package.json b/packages/visx-react-spring/package.json
index 79cd1d908..cfe423cd5 100644
--- a/packages/visx-react-spring/package.json
+++ b/packages/visx-react-spring/package.json
@@ -38,7 +38,7 @@
"access": "public"
},
"peerDependencies": {
- "react": "^16.3.0-0",
+ "react": "^16.3.0-0 || ^17.0.0",
"react-spring": "^9.2.0"
},
"dependencies": {
diff --git a/packages/visx-responsive/package.json b/packages/visx-responsive/package.json
index 6146201f3..acc45790e 100644
--- a/packages/visx-responsive/package.json
+++ b/packages/visx-responsive/package.json
@@ -35,7 +35,7 @@
"resize-observer-polyfill": "1.5.1"
},
"peerDependencies": {
- "react": "^15.0.0-0 || ^16.0.0-0"
+ "react": "^16.0.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-responsive/test/ScaleSVG.test.tsx b/packages/visx-responsive/test/ScaleSVG.test.tsx
index 4c9782bcf..dfafa09c8 100644
--- a/packages/visx-responsive/test/ScaleSVG.test.tsx
+++ b/packages/visx-responsive/test/ScaleSVG.test.tsx
@@ -1,6 +1,6 @@
import React from 'react';
-import { mount } from 'enzyme';
-
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { ScaleSVG } from '../src';
describe('', () => {
@@ -9,14 +9,9 @@ describe('', () => {
});
test('it should expose its ref via an innerRef prop', () => {
- // eslint-disable-next-line require-await
- return new Promise(done => {
- const refCallback = (n: SVGSVGElement) => {
- expect(n.tagName).toEqual('svg');
- done();
- };
-
- mount();
- });
+ const fakeRef = React.createRef();
+ const { container } = render();
+ const SVGElement = container.querySelector('svg');
+ expect(fakeRef.current).toContainElement(SVGElement);
});
});
diff --git a/packages/visx-responsive/test/withParentSize.test.tsx b/packages/visx-responsive/test/withParentSize.test.tsx
index 725123382..97e37ef08 100644
--- a/packages/visx-responsive/test/withParentSize.test.tsx
+++ b/packages/visx-responsive/test/withParentSize.test.tsx
@@ -1,39 +1,27 @@
import React from 'react';
-import { mount } from 'enzyme';
-
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { withParentSize } from '../src';
-describe('withParentSize', () => {
- beforeAll(() => {
- // mock getBoundingClientRect
- Element.prototype.getBoundingClientRect = jest.fn(() => ({
- width: 220,
- height: 120,
- top: 0,
- left: 0,
- bottom: 0,
- right: 0,
- x: 0,
- y: 0,
- toJSON: () => '',
- }));
- });
+type ComponentProps = {
+ parentWidth?: number;
+ parentHeight?: number;
+};
+function Component({ parentWidth, parentHeight }: ComponentProps) {
+ return ;
+}
+
+describe('withParentSize', () => {
test('it should be defined', () => {
expect(withParentSize).toBeDefined();
});
test('it chould pass parentWidth and parentHeight props to its child', () => {
- const Component = () => ;
const HOC = withParentSize(Component);
- const wrapper = mount();
+ const { getByTestId } = render();
- // wait for the resizeObserver to run
- setTimeout(() => {
- const RenderedComponent = wrapper.find(Component);
- expect(Element.prototype.getBoundingClientRect).toHaveBeenCalled();
- expect(RenderedComponent.prop('parentWidth')).toBe(220);
- expect(RenderedComponent.prop('parentHeight')).toBe(120);
- }, 0);
+ const RenderedComponent = getByTestId('Component');
+ expect(RenderedComponent).toHaveStyle('width: 200px; height: 200px');
});
});
diff --git a/packages/visx-shape/package.json b/packages/visx-shape/package.json
index 79b8ddee2..7a065722b 100644
--- a/packages/visx-shape/package.json
+++ b/packages/visx-shape/package.json
@@ -35,7 +35,7 @@
"prop-types": "^15.5.10"
},
"peerDependencies": {
- "react": "^16.3.0-0"
+ "react": "^16.3.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-shape/test/Arc.test.tsx b/packages/visx-shape/test/Arc.test.tsx
index 112579f85..475f14156 100644
--- a/packages/visx-shape/test/Arc.test.tsx
+++ b/packages/visx-shape/test/Arc.test.tsx
@@ -1,9 +1,9 @@
import React from 'react';
import mockConsole from 'jest-mock-console';
-import { shallow, mount } from 'enzyme';
-
+import { render } from '@testing-library/react';
import { Arc } from '../src';
import { ArcProps } from '../src/shapes/Arc';
+import '@testing-library/jest-dom';
interface Datum {
data: number;
@@ -23,11 +23,8 @@ const data: Datum = {
padAngle: 0,
};
-const ArcWrapper = (overrideProps: Partial> = { data }) =>
- shallow();
-
const ArcChildren = ({ children, ...restProps }: Partial>) =>
- shallow(
+ render(
{children}
,
@@ -38,25 +35,36 @@ describe('', () => {
expect(Arc).toBeDefined();
});
- it('should have the .visx-arcs-group class', () => {
- expect(ArcWrapper().prop('className')).toBe('visx-arc');
- });
-
- it('should render a path', () => {
- expect(ArcWrapper().find('path')).toHaveLength(1);
+ it('should render a path that has the .visx-arcs-group class', () => {
+ const { container } = render(
+ ,
+ );
+ const PathElement = container.querySelector('path');
+ expect(PathElement).toBeInTheDocument();
+ expect(PathElement).toHaveClass('visx-arc');
});
it('should warn and render null when none of data, radii, and angles are passed', () => {
const restoreConsole = mockConsole();
- expect(ArcWrapper({}).find('path')).toHaveLength(0);
+ const { container } = render(
+ ,
+ );
+ expect(container.querySelector('path')).not.toBeInTheDocument();
expect(console.warn).toHaveBeenCalledTimes(1);
restoreConsole();
});
it('should render a path without data when radii + angles are defined', () => {
- expect(
- ArcWrapper({ startAngle: 0, endAngle: 6, innerRadius: 5, outerRadius: 10 }).find('path'),
- ).toHaveLength(1);
+ const { container } = render(
+ ,
+ );
+ expect(container.querySelector('path')).toBeInTheDocument();
});
it('should take a children as function prop', () => {
@@ -207,17 +215,14 @@ describe('', () => {
});
it('should expose its ref via an innerRef prop', () => {
- // eslint-disable-next-line jest/no-test-return-statement
- return new Promise(done => {
- const refCallback = (ref: SVGPathElement) => {
- expect(ref.tagName).toMatch('path');
- done();
- };
- mount(
- ,
- );
- });
+ const fakeRef = React.createRef();
+
+ const { container } = render(
+ ,
+ );
+ const PathElement = container.querySelector('path');
+ expect(fakeRef.current).toContainElement(PathElement);
});
});
diff --git a/packages/visx-shape/test/Area.test.tsx b/packages/visx-shape/test/Area.test.tsx
index b97927c07..24011aa2d 100644
--- a/packages/visx-shape/test/Area.test.tsx
+++ b/packages/visx-shape/test/Area.test.tsx
@@ -1,5 +1,7 @@
import React from 'react';
-import { shallow, mount } from 'enzyme';
+import { shallow } from 'enzyme';
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { Area } from '../src';
import { AreaProps } from '../src/shapes/Area';
@@ -40,18 +42,14 @@ describe('', () => {
});
test('it should expose its ref via an innerRef prop', () => {
- // eslint-disable-next-line jest/no-test-return-statement
- return new Promise(done => {
- const refCallback = (ref: SVGPathElement) => {
- expect(ref.tagName).toMatch('path');
- done();
- };
- mount(
- ,
- );
- });
+ const fakeRef = React.createRef();
+ const { container } = render(
+ ,
+ );
+ const PathElement = container.querySelector('path');
+ expect(fakeRef.current).toContainElement(PathElement);
});
test('it should take a children as function prop', () => {
diff --git a/packages/visx-shape/test/AreaClosed.test.tsx b/packages/visx-shape/test/AreaClosed.test.tsx
index 779b23e4d..7002779a9 100644
--- a/packages/visx-shape/test/AreaClosed.test.tsx
+++ b/packages/visx-shape/test/AreaClosed.test.tsx
@@ -1,5 +1,7 @@
import React from 'react';
-import { shallow, mount } from 'enzyme';
+import { shallow } from 'enzyme';
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { scaleLinear } from '@visx/scale';
import { AreaClosed } from '../src';
@@ -41,17 +43,14 @@ describe('', () => {
});
test('it should expose its ref via an innerRef prop', () => {
- return new Promise(done => {
- const refCallback = (ref: SVGPathElement) => {
- expect(ref.tagName).toMatch('path');
- done();
- };
- mount(
- ,
- );
- });
+ const fakeRef = React.createRef();
+ const { container } = render(
+ ,
+ );
+ const PathElement = container.querySelector('path');
+ expect(fakeRef.current).toContainElement(PathElement);
});
test('it should take a children as function prop', () => {
diff --git a/packages/visx-shape/test/Bar.test.tsx b/packages/visx-shape/test/Bar.test.tsx
index a5c185853..ba0617544 100644
--- a/packages/visx-shape/test/Bar.test.tsx
+++ b/packages/visx-shape/test/Bar.test.tsx
@@ -1,5 +1,7 @@
import React from 'react';
-import { shallow, mount } from 'enzyme';
+import { shallow } from 'enzyme';
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { Bar } from '../src';
@@ -19,17 +21,13 @@ describe('', () => {
});
test('it should expose its ref via an innerRef prop', () => {
- // eslint-disable-next-line jest/no-test-return-statement
- return new Promise(done => {
- const refCallback = (ref: SVGRectElement) => {
- expect(ref.tagName).toMatch('rect');
- done();
- };
- mount(
- ,
- );
- });
+ const fakeRef = React.createRef();
+ const { container } = render(
+ ,
+ );
+ const RectElement = container.querySelector('rect');
+ expect(fakeRef.current).toContainElement(RectElement);
});
});
diff --git a/packages/visx-shape/test/BarRounded.test.tsx b/packages/visx-shape/test/BarRounded.test.tsx
index 776d36923..32e031d13 100644
--- a/packages/visx-shape/test/BarRounded.test.tsx
+++ b/packages/visx-shape/test/BarRounded.test.tsx
@@ -1,5 +1,7 @@
import React from 'react';
-import { shallow, mount } from 'enzyme';
+import { shallow } from 'enzyme';
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { BarRounded } from '../src';
@@ -20,18 +22,14 @@ describe('', () => {
});
test('it should expose its ref via an innerRef prop', () => {
- // eslint-disable-next-line jest/no-test-return-statement
- return new Promise(done => {
- const refCallback = (ref: SVGPathElement) => {
- expect(ref.tagName).toMatch('path');
- done();
- };
- mount(
- ,
- );
- });
+ const fakeRef = React.createRef();
+ const { container } = render(
+ ,
+ );
+ const PathElement = container.querySelector('path');
+ expect(fakeRef.current).toContainElement(PathElement);
});
test('it should set top left corner radius', () => {
diff --git a/packages/visx-shape/test/Circle.test.tsx b/packages/visx-shape/test/Circle.test.tsx
index c7b77eebf..05b6aca42 100644
--- a/packages/visx-shape/test/Circle.test.tsx
+++ b/packages/visx-shape/test/Circle.test.tsx
@@ -1,5 +1,7 @@
import React from 'react';
-import { shallow, mount } from 'enzyme';
+import { shallow } from 'enzyme';
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { Circle } from '../src';
@@ -19,17 +21,13 @@ describe('', () => {
});
test('it should expose its ref via an innerRef prop', () => {
- // eslint-disable-next-line jest/no-test-return-statement
- return new Promise(done => {
- const refCallback = (ref: SVGCircleElement) => {
- expect(ref.tagName).toMatch('circle');
- done();
- };
- mount(
- ,
- );
- });
+ const fakeRef = React.createRef();
+ const { container } = render(
+ ,
+ );
+ const CircleElement = container.querySelector('circle');
+ expect(fakeRef.current).toContainElement(CircleElement);
});
});
diff --git a/packages/visx-shape/test/Line.test.tsx b/packages/visx-shape/test/Line.test.tsx
index 715baa919..d0df3ff0c 100644
--- a/packages/visx-shape/test/Line.test.tsx
+++ b/packages/visx-shape/test/Line.test.tsx
@@ -1,6 +1,7 @@
import React from 'react';
-import { shallow, mount } from 'enzyme';
-
+import { shallow } from 'enzyme';
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { Line } from '../src';
const LineWrapper = (restProps = {}) => shallow();
@@ -19,18 +20,14 @@ describe('', () => {
});
test('it should expose its ref via an innerRef prop', () => {
- // eslint-disable-next-line jest/no-test-return-statement
- return new Promise(done => {
- const refCallback = (ref: SVGLineElement) => {
- expect(ref.tagName).toMatch('line');
- done();
- };
- mount(
- ,
- );
- });
+ const fakeRef = React.createRef();
+ const { container } = render(
+ ,
+ );
+ const LineElement = container.querySelector('line');
+ expect(fakeRef.current).toContainElement(LineElement);
});
test('it should set shapeRendering to auto if not rectilinear', () => {
diff --git a/packages/visx-shape/test/LinePath.test.tsx b/packages/visx-shape/test/LinePath.test.tsx
index a570be8fb..b22ac0ade 100644
--- a/packages/visx-shape/test/LinePath.test.tsx
+++ b/packages/visx-shape/test/LinePath.test.tsx
@@ -1,5 +1,7 @@
import React from 'react';
-import { shallow, mount } from 'enzyme';
+import { shallow } from 'enzyme';
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { LinePath } from '../src';
import { LinePathProps } from '../src/shapes/LinePath';
@@ -54,17 +56,14 @@ describe('', () => {
});
it('should expose its ref via an innerRef prop', () => {
- // eslint-disable-next-line jest/no-test-return-statement
- return new Promise(done => {
- const refCallback = (ref: SVGPathElement) => {
- expect(ref.tagName).toMatch('path');
- done();
- };
- mount(
- ,
- );
- });
+ const fakeRef = React.createRef();
+
+ const { container } = render(
+ ,
+ );
+ const PathElement = container.querySelector('path');
+ expect(fakeRef.current).toContainElement(PathElement);
});
});
diff --git a/packages/visx-shape/test/LineRadial.test.tsx b/packages/visx-shape/test/LineRadial.test.tsx
index e0c69de2e..97c01112e 100644
--- a/packages/visx-shape/test/LineRadial.test.tsx
+++ b/packages/visx-shape/test/LineRadial.test.tsx
@@ -1,6 +1,7 @@
import React from 'react';
-import { shallow, mount } from 'enzyme';
-
+import { shallow } from 'enzyme';
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { LineRadial } from '../src';
import { LineRadialProps } from '../src/shapes/LineRadial';
@@ -50,17 +51,13 @@ describe('', () => {
});
test('it should expose its ref via an innerRef prop', () => {
- // eslint-disable-next-line jest/no-test-return-statement
- return new Promise(done => {
- const refCallback = (ref: SVGPathElement) => {
- expect(ref.tagName).toMatch('path');
- done();
- };
- mount(
- ,
- );
- });
+ const fakeRef = React.createRef();
+ const { container } = render(
+ ,
+ );
+ const PathElement = container.querySelector('path');
+ expect(fakeRef.current).toContainElement(PathElement);
});
});
diff --git a/packages/visx-shape/test/LinkHorizontal.test.tsx b/packages/visx-shape/test/LinkHorizontal.test.tsx
index abdb67685..8c4299046 100644
--- a/packages/visx-shape/test/LinkHorizontal.test.tsx
+++ b/packages/visx-shape/test/LinkHorizontal.test.tsx
@@ -1,6 +1,6 @@
import React from 'react';
-import { mount } from 'enzyme';
-
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { hierarchy } from 'd3-hierarchy';
import { LinkHorizontal } from '../src';
@@ -23,17 +23,13 @@ describe('', () => {
});
test('it should expose its ref via an innerRef prop', () => {
- // eslint-disable-next-line jest/no-test-return-statement
- return new Promise(done => {
- const refCallback = (ref: SVGPathElement) => {
- expect(ref.tagName).toMatch('path');
- done();
- };
- mount(
- ,
- );
- });
+ const fakeRef = React.createRef();
+ const { container } = render(
+ ,
+ );
+ const PathElement = container.querySelector('path');
+ expect(fakeRef.current).toContainElement(PathElement);
});
});
diff --git a/packages/visx-shape/test/LinkVertical.test.tsx b/packages/visx-shape/test/LinkVertical.test.tsx
index 9b6b4f979..0c9e6a8e2 100644
--- a/packages/visx-shape/test/LinkVertical.test.tsx
+++ b/packages/visx-shape/test/LinkVertical.test.tsx
@@ -1,6 +1,6 @@
import React from 'react';
-import { mount } from 'enzyme';
-
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { hierarchy } from 'd3-hierarchy';
import { LinkVertical } from '../src';
@@ -22,17 +22,14 @@ describe('', () => {
});
test('it should expose its ref via an innerRef prop', () => {
- // eslint-disable-next-line jest/no-test-return-statement
- return new Promise(done => {
- const refCallback = (ref: SVGPathElement) => {
- expect(ref.tagName).toMatch('path');
- done();
- };
- mount(
- ,
- );
- });
+ const fakeRef = React.createRef();
+
+ const { container } = render(
+ ,
+ );
+ const PathElement = container.querySelector('path');
+ expect(fakeRef.current).toContainElement(PathElement);
});
});
diff --git a/packages/visx-stats/package.json b/packages/visx-stats/package.json
index e0cbb35e7..85c2d1657 100644
--- a/packages/visx-stats/package.json
+++ b/packages/visx-stats/package.json
@@ -37,7 +37,7 @@
"prop-types": "^15.5.10"
},
"peerDependencies": {
- "react": "^16.3.0-0"
+ "react": "^16.3.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-text/package.json b/packages/visx-text/package.json
index 5fe416875..853654d4a 100644
--- a/packages/visx-text/package.json
+++ b/packages/visx-text/package.json
@@ -36,7 +36,7 @@
"reduce-css-calc": "^1.3.0"
},
"peerDependencies": {
- "react": "^16.3.0-0"
+ "react": "^16.3.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-text/test/Text.test.tsx b/packages/visx-text/test/Text.test.tsx
index f025c67ab..89278fdc2 100644
--- a/packages/visx-text/test/Text.test.tsx
+++ b/packages/visx-text/test/Text.test.tsx
@@ -1,6 +1,7 @@
import React from 'react';
-import { shallow, mount } from 'enzyme';
+import { render } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
+import '@testing-library/jest-dom';
import { Text, getStringWidth, useText } from '../src';
import { addMock, removeMock } from './svgMock';
@@ -18,11 +19,6 @@ describe('', () => {
expect(Text).toBeDefined();
});
- it('should not throw', () => {
- expect(() => shallow()).not.toThrow();
- expect(() => shallow(Hi)).not.toThrow();
- });
-
it('Does not wrap long text if enough width', () => {
const {
result: {
@@ -87,54 +83,56 @@ describe('', () => {
});
it('Render 0 success when specify the width', () => {
- const wrapper = mount(
+ const { container } = render(
0
,
);
- console.log('wrapper', wrapper.text());
- expect(wrapper.text()).toContain('0');
+ const text = container.querySelector('tspan');
+ expect(text?.textContent).toEqual('0');
});
it('Render 0 success when not specify the width', () => {
- const wrapper = mount(
+ const { container } = render(
0
,
);
-
- expect(wrapper.text()).toContain('0');
+ const text = container.querySelector('tspan');
+ expect(text?.textContent).toEqual('0');
});
it('Render text when x or y is a percentage', () => {
- const wrapper = mount(
+ const { container } = render(
anything
,
);
-
- expect(wrapper.text()).toContain('anything');
+ const text = container.querySelector('tspan');
+ expect(text?.textContent).toEqual('anything');
});
it("Don't Render text when x or y is NaN", () => {
- const wrapperNan = mount(
+ const { container } = render(
anything
,
);
-
- expect(wrapperNan.text()).not.toContain('anything');
+ const text = container.querySelector('tspan');
+ expect(text).toBeNull();
});
it('Render text when children 0 is a number', () => {
- const wrapper = mount(
+ const num = 0;
+ const { container } = render(
- {0}
+ {num}
,
);
- expect(wrapper.text()).toContain('0');
+ const text = container.querySelector('tspan');
+ expect(text?.textContent).toEqual('0');
});
it('Applies transform if scaleToFit is set', () => {
@@ -154,42 +152,38 @@ describe('', () => {
});
it('Applies transform if angle is given', () => {
- const wrapper = shallow(
+ const { container } = render(
This is really long text
,
);
- const text = wrapper.find('text').first();
- expect(text.prop('transform')).toBe('rotate(45, 0, 0)');
+ const text = container.querySelector('text');
+ expect(text).toHaveAttribute('transform', 'rotate(45, 0, 0)');
});
it('Offsets vertically if verticalAnchor is given', () => {
- let wrapper = mount(
+ let { container } = render(
This is really long text
,
);
- const getVerticalOffset = (w: typeof wrapper) =>
- w
- .find('tspan')
- .first()
- .prop('dy');
+ const getVerticalOffset = (c: HTMLElement) => c?.querySelector('tspan')?.getAttribute('dy');
- expect(getVerticalOffset(wrapper)).toBe('-1em');
+ expect(getVerticalOffset(container)).toBe('-1em');
- wrapper = mount(
+ ({ container } = render(
This is really long text
,
- );
- expect(getVerticalOffset(wrapper)).toBe('-0.145em');
+ ));
+ expect(getVerticalOffset(container)).toBe('-0.145em');
- wrapper = mount(
+ ({ container } = render(
This is really long text
,
- );
- expect(getVerticalOffset(wrapper)).toBe('0.71em');
+ ));
+ expect(getVerticalOffset(container)).toBe('0.71em');
});
});
diff --git a/packages/visx-threshold/package.json b/packages/visx-threshold/package.json
index 45ec280a0..cd028142d 100644
--- a/packages/visx-threshold/package.json
+++ b/packages/visx-threshold/package.json
@@ -31,7 +31,7 @@
"prop-types": "^15.5.10"
},
"peerDependencies": {
- "react": "^15.0.0-0 || ^16.0.0-0"
+ "react": "^16.0.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-tooltip/package.json b/packages/visx-tooltip/package.json
index b6b8f10b4..7f73975e2 100644
--- a/packages/visx-tooltip/package.json
+++ b/packages/visx-tooltip/package.json
@@ -35,8 +35,8 @@
"react-use-measure": "^2.0.4"
},
"peerDependencies": {
- "react": "^16.8.0-0",
- "react-dom": "^16.8.0-0"
+ "react": "^16.8.0-0 || ^17.0.0-0",
+ "react-dom": "^16.8.0-0 || ^17.0.0-0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/visx-visx/package.json b/packages/visx-visx/package.json
index e62cbb5ec..d777b84e0 100644
--- a/packages/visx-visx/package.json
+++ b/packages/visx-visx/package.json
@@ -30,7 +30,7 @@
"access": "public"
},
"peerDependencies": {
- "react": "^16.3.0-0"
+ "react": "^16.3.0-0 || ^17.0.0-0"
},
"dependencies": {
"@visx/annotation": "1.18.1",
diff --git a/packages/visx-voronoi/package.json b/packages/visx-voronoi/package.json
index cac679139..f6f94e3e9 100644
--- a/packages/visx-voronoi/package.json
+++ b/packages/visx-voronoi/package.json
@@ -38,6 +38,6 @@
"prop-types": "^15.6.1"
},
"peerDependencies": {
- "react": "^16.3.0-0"
+ "react": "^16.3.0-0 || ^17.0.0-0"
}
}
diff --git a/packages/visx-xychart/package.json b/packages/visx-xychart/package.json
index 2b549b185..61cab1af0 100644
--- a/packages/visx-xychart/package.json
+++ b/packages/visx-xychart/package.json
@@ -36,7 +36,7 @@
"access": "public"
},
"peerDependencies": {
- "react": "^16.4.0-0",
+ "react": "^16.8.0 || ^17.0.0",
"react-spring": "^9.2.0"
},
"dependencies": {
diff --git a/packages/visx-xychart/test/components/Annotation.test.tsx b/packages/visx-xychart/test/components/Annotation.test.tsx
index ac21ab1bd..beb6510c5 100644
--- a/packages/visx-xychart/test/components/Annotation.test.tsx
+++ b/packages/visx-xychart/test/components/Annotation.test.tsx
@@ -1,16 +1,13 @@
import React from 'react';
-import { mount } from 'enzyme';
-import {
- Annotation as VxAnnotation,
- EditableAnnotation as VxEditableAnnotation,
-} from '@visx/annotation';
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { DataContext, Annotation, AnimatedAnnotation } from '../../src';
import getDataContext from '../mocks/getDataContext';
const series = { key: 'visx', data: [{}], xAccessor: () => 4, yAccessor: () => 7 };
function setup(children: React.ReactNode) {
- return mount(
+ return render(
,
@@ -22,20 +19,22 @@ describe('', () => {
expect(Annotation).toBeDefined();
});
it('should render a VxAnnotation', () => {
- const wrapper = setup(
+ const { getByText } = setup(
{'test'}
,
);
- expect(wrapper.find(VxAnnotation)).toHaveLength(1);
+ expect(getByText('test')).toBeInTheDocument();
});
it('should render a VxEditableAnnotation when editable=true', () => {
- const wrapper = setup(
+ const { container } = setup(
{'test'}
,
);
- expect(wrapper.find(VxEditableAnnotation)).toHaveLength(1);
+ // with editable=true, the svg should have a circle overlay with 'cursor: grab' attribute
+ const CircleElement = container.querySelector('circle');
+ expect(CircleElement).toHaveAttribute('cursor');
});
});
@@ -44,19 +43,22 @@ describe('', () => {
expect(AnimatedAnnotation).toBeDefined();
});
it('should render a VxAnnotation', () => {
- const wrapper = setup(
+ const { getByText } = setup(
{'test'}
,
);
- expect(wrapper.find(VxAnnotation)).toHaveLength(1);
+ expect(getByText('test')).toBeInTheDocument();
});
it('should render a VxEditableAnnotation when editable=true', () => {
- const wrapper = setup(
+ const { container } = setup(
{'test'}
,
);
- expect(wrapper.find(VxEditableAnnotation)).toHaveLength(1);
+
+ // with editable=true, the svg should have a circle overlay with 'cursor: grab' attribute
+ const CircleElement = container.querySelector('circle');
+ expect(CircleElement).toHaveAttribute('cursor');
});
});
diff --git a/packages/visx-xychart/test/components/AreaSeries.test.tsx b/packages/visx-xychart/test/components/AreaSeries.test.tsx
index 9e8a39552..15c1e69f7 100644
--- a/packages/visx-xychart/test/components/AreaSeries.test.tsx
+++ b/packages/visx-xychart/test/components/AreaSeries.test.tsx
@@ -1,7 +1,6 @@
import React, { useContext, useEffect } from 'react';
-import { animated } from 'react-spring';
-import { mount } from 'enzyme';
-import { Area, LinePath } from '@visx/shape';
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import { AnimatedAreaSeries, DataContext, AreaSeries, useEventEmitter } from '../../src';
import getDataContext from '../mocks/getDataContext';
import setupTooltipTest from '../mocks/setupTooltipTest';
@@ -15,31 +14,33 @@ describe('', () => {
});
it('should render an Area', () => {
- const wrapper = mount(
+ const { container } = render(
,
);
- // @ts-ignore produces a union type that is too complex to represent.ts(2590)
- expect(wrapper.find(Area)).toHaveLength(1);
+ const Path = container.querySelector('path');
+ expect(Path).toBeInTheDocument();
});
it('should set strokeLinecap="round" to make datum surrounded by nulls visible', () => {
- const wrapper = mount(
+ const { container } = render(
,
);
- expect(wrapper.find('path').prop('strokeLinecap')).toBe('round');
+ const Path = container.querySelector('path');
+ expect(Path).toBeInTheDocument();
+ expect(Path).toHaveAttribute('stroke-linecap', 'round');
});
- it('should use x/y0Accessors an Area', () => {
+ it('should use x/y0Accessors in an Area', () => {
const y0Accessor = jest.fn(() => 3);
- const wrapper = mount(
+ const { container } = render(
,
);
- const callCount = y0Accessor.mock.calls.length;
+ const Path = container.querySelector('path');
+ expect(Path).toBeInTheDocument();
expect(y0Accessor).toHaveBeenCalled();
- const y0Area = wrapper.find(Area).prop('y0') as Function;
- y0Area();
- expect(y0Accessor).toHaveBeenCalledTimes(callCount + 1);
});
it('should render a LinePath is renderLine=true', () => {
- const wrapper = mount(
+ const { container } = render(
,
);
- // @ts-ignore produces a union type that is too complex to represent.ts(2590)
- expect(wrapper.find(LinePath)).toHaveLength(1);
+
+ const LinePath = container.querySelector('.visx-line');
+ expect(LinePath).toBeInTheDocument();
});
it('should render Glyphs if focus/blur handlers are set', () => {
- const wrapper = mount(
+ const { container } = render(
,
);
- expect(wrapper.find('circle')).toHaveLength(series.data.length);
+
+ const Circles = container.querySelectorAll('circle');
+ expect(Circles).toHaveLength(series.data.length);
});
it('should invoke showTooltip/hideTooltip on pointermove/pointerout', () => {
@@ -123,13 +125,14 @@ describe('', () => {
expect(AnimatedAreaSeries).toBeDefined();
});
it('should render an animated.path', () => {
- const wrapper = mount(
+ const { container } = render(
,
);
- expect(wrapper.find(animated.path)).toHaveLength(1);
+ const Path = container.querySelectorAll('path');
+ expect(Path).toHaveLength(1);
});
});
diff --git a/packages/visx-xychart/test/components/AreaStack.test.tsx b/packages/visx-xychart/test/components/AreaStack.test.tsx
index 80aa41da2..a2acf1ef5 100644
--- a/packages/visx-xychart/test/components/AreaStack.test.tsx
+++ b/packages/visx-xychart/test/components/AreaStack.test.tsx
@@ -1,7 +1,6 @@
import React, { useContext, useEffect } from 'react';
-import { mount } from 'enzyme';
-import { animated } from 'react-spring';
-import { Area, LinePath } from '@visx/shape';
+import { render } from '@testing-library/react';
+import '@testing-library/jest-dom';
import {
AreaStack,
AreaSeries,
@@ -48,7 +47,7 @@ describe('', () => {
});
it('should render Areas', () => {
- const wrapper = mount(
+ const { container } = render(
,
);
- // @ts-ignore produces a union type that is too complex to represent.ts(2590)
- expect(wrapper.find(Area)).toHaveLength(2);
+ const Areas = container.querySelectorAll('.visx-area');
+ expect(Areas).toHaveLength(2);
});
it('should render LinePaths if renderLine=true', () => {
- const wrapper = mount(
+ const { container } = render(
,
);
- // @ts-ignore produces a union type that is too complex to represent.ts(2590)
- expect(wrapper.find(LinePath)).toHaveLength(2);
+ const LinePaths = container.querySelectorAll('.visx-line');
+ expect(LinePaths).toHaveLength(2);
});
it('should render Glyphs if focus/blur handlers are set', () => {
- const wrapper = mount(
+ const { container } = render(
,
);
- expect(wrapper.find('circle')).toHaveLength(series1.data.length);
+ const Circles = container.querySelectorAll('circle');
+ expect(Circles).toHaveLength(series1.data.length);
});
it('should update scale domain to include stack sums including negative values', () => {
@@ -101,7 +101,7 @@ describe('', () => {
return null;
}
- mount(
+ render(