Skip to content

Commit

Permalink
Fix formatting hopefully
Browse files Browse the repository at this point in the history
  • Loading branch information
Zenith00 committed May 2, 2022
1 parent c63c81a commit 8c8557f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type BaseLineSeriesProps<
/** Sets the curve factory (from @visx/curve or d3-curve) for the line generator. Defaults to curveLinear. */
curve?: LinePathProps<Datum>['curve'];
/** Given a datakey, returns its color. Falls back to theme color if unspecified or if a null-ish value is returned. */
colorAccessor?: (dataKey: string) => string | undefined | null,
colorAccessor?: (dataKey: string) => string | undefined | null;
} & Omit<React.SVGProps<SVGPathElement>, 'x' | 'y' | 'x0' | 'x1' | 'y0' | 'y1' | 'ref'>;

function BaseLineSeries<XScale extends AxisScale, YScale extends AxisScale, Datum extends object>({
Expand Down
10 changes: 3 additions & 7 deletions packages/visx-xychart/test/components/LineSeries.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,14 @@ describe('<LineSeries />', () => {
});

it('should use colorAccessor if passed', () => {
const {container} = render(
const { container } = render(
<DataContext.Provider value={getDataContext(series)}>
<svg>
<LineSeries
dataKey={series.key}
{...series}
colorAccessor={(_) => 'banana'}
/>
<LineSeries dataKey={series.key} {...series} colorAccessor={(_) => 'banana'} />
</svg>
</DataContext.Provider>,
);
expect(container.querySelector('path')).toHaveAttribute('stroke', 'banana')
expect(container.querySelector('path')).toHaveAttribute('stroke', 'banana');
});
});

Expand Down

0 comments on commit 8c8557f

Please sign in to comment.