Update recharts dependency to v2.0.0 and fix breaking changes

Signed-off-by: Leonardo Maier <leonarmaier@gmail.com>
Signed-off-by: Leonardo Maier <lmaier_c@wellapp.com>
This commit is contained in:
Leonardo Maier
2022-09-03 11:28:24 -03:00
committed by Fredrik Adelöw
parent a82d7ac0ef
commit 43afded227
18 changed files with 249 additions and 243 deletions
+1 -1
View File
@@ -33,7 +33,7 @@
"lodash": "^4.17.21",
"luxon": "^3.0.0",
"react-use": "^17.2.4",
"recharts": "^1.8.5"
"recharts": "^2.0.0"
},
"peerDependencies": {
"react": "^16.13.1 || ^17.0.0"
@@ -21,6 +21,24 @@ jest.mock('../../api/XcmetricsClient');
const client = require('../../api/XcmetricsClient');
describe('BuildTimeline', () => {
const { ResizeObserver } = window;
beforeEach(() => {
// @ts-expect-error: Since we have strictNullChecks enabled, this will throw an error as window.ResizeObserver
// it's not an optional operand
delete window.ResizeObserver;
window.ResizeObserver = jest.fn().mockImplementation(() => ({
observe: jest.fn(),
unobserve: jest.fn(),
disconnect: jest.fn(),
}));
});
afterEach(() => {
window.ResizeObserver = ResizeObserver;
jest.restoreAllMocks();
});
it('should render', async () => {
const rendered = await renderInTestApp(
<BuildTimeline targets={[client.mockTarget]} height={100} width={100} />,