Our widget snapshot tests are not covering the plots generated by recharts, the container divs are simply empty:
|
<div |
|
className="recharts-responsive-container" |
|
style={ |
|
Object { |
|
"height": "100%", |
|
"maxHeight": undefined, |
|
"minHeight": undefined, |
|
"minWidth": undefined, |
|
"width": "100%", |
|
} |
|
} |
|
/> |
|
</div> |
We should consider testing them. It might, however, not be very easy: when I tried in #1112, I encountered the issue that the tests generated different snapshots on my devince than in the CI.
We should update to recharts v3 (#1111) first.
The following mock snippet might be useful – to be placed under src/__mocks__/recharts:
import React from 'react';
module.exports = {
...jest.requireActual('recharts'),
ResponsiveContainer: ({ children }: { children: any }) =>
React.cloneElement(React.Children.only(children), { width: 800, height: 400 }),
};
Our widget snapshot tests are not covering the plots generated by recharts, the container divs are simply empty:
cov-spectrum-website/src/widgets/__tests__/__snapshots__/VariantTimeDistributionLineChart.test.tsx.snap
Lines 127 to 139 in 6b7ad13
We should consider testing them. It might, however, not be very easy: when I tried in #1112, I encountered the issue that the tests generated different snapshots on my devince than in the CI.
We should update to recharts v3 (#1111) first.
The following mock snippet might be useful – to be placed under
src/__mocks__/recharts: