Skip to content

Commit

Permalink
fix(area-dot): regressionon in parameters passed to custom area dot
Browse files Browse the repository at this point in the history
  • Loading branch information
Coltin Kifer committed May 3, 2024
1 parent 22064ed commit 239b3ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cartesian/Area.tsx
Expand Up @@ -325,12 +325,13 @@ export class Area extends PureComponent<Props, State> {
r: 3,
...areaProps,
...customDotProps,
dataKey,
index: i,
cx: entry.x,
cy: entry.y,
index: i,
dataKey,
value: entry.value,
payload: entry.payload,
points,
};

return Area.renderDotItem(dot, dotProps);
Expand Down
3 changes: 3 additions & 0 deletions test/cartesian/Area.spec.tsx
Expand Up @@ -113,8 +113,10 @@ describe.each(chartsThatSupportArea)('<Area /> as a child of $testName', ({ Char

describe('dot', () => {
test('Render customized dot when dot is set to be a function', () => {
let areaDotProps;
const renderDot = (props: { cx: number; cy: number }) => {
const { cx, cy } = props;
areaDotProps = props;

return <circle role="cell" key={cx} x={cx} y={cy} r={5} className="customized-dot" />;
};
Expand All @@ -126,6 +128,7 @@ describe.each(chartsThatSupportArea)('<Area /> as a child of $testName', ({ Char
);

expect(screen.getAllByRole('cell')).toHaveLength(data.length);
expect(areaDotProps).toHaveProperty('points');
});

test('Render customized dot when dot is set to be a react element', () => {
Expand Down

0 comments on commit 239b3ae

Please sign in to comment.