Skip to content

Commit

Permalink
Replace seriestypes shallow rendering tests (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
anajavi authored Aug 8, 2024
1 parent 3ec72e4 commit 78de12d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,38 @@ Object.keys(all)
expect(seriesRef.current.object.yAxis.userOptions.id).toBe(
'myYAxis'
);
} else {
expect(seriesRef.current.object.yAxis).not.toBeDefined();
}
});

it('passes props to series', () => {
const seriesRef = {};

const Component = () => {
return (
<React.StrictMode>
<HighchartsProvider Highcharts={Highcharts}>
<HighchartsChart>
<Chart zoomType="x" />
<XAxis></XAxis>
<YAxis>
<SeriesComponent data={[1, 2, 3, 4]} zIndex={-1}>
<ContextSpy seriesRef={seriesRef} />
</SeriesComponent>
</YAxis>
</HighchartsChart>
</HighchartsProvider>
</React.StrictMode>
);
};

render(<Component />);
const seriesObj = seriesRef.current.object;
expect(seriesObj.userOptions.data).toEqual([1, 2, 3, 4]);
expect(seriesObj.userOptions.zIndex).toEqual(-1);
});

it('binds hide event correctly', () => {
const seriesRef = {};
const onHide = jest.fn();
Expand Down

This file was deleted.

0 comments on commit 78de12d

Please sign in to comment.