Skip to content

Commit

Permalink
Fixes on LineChart tests
Browse files Browse the repository at this point in the history
  • Loading branch information
v3gaaa committed Oct 23, 2024
1 parent cb634d6 commit 18d2291
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/LineChart/LineChart.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('LineChart', () => {
it('renders without crashing', () => {
const { container } = render(
<LineChart width={500} height={300} data={mockData}>
<Line dataKey="uv" stroke="#8884d8" />
<Line dataKey="uv" stroke="#8884d8" data={mockData} xScale={(value) => value} yScale={(value) => value} />
</LineChart>
);
expect(container).toBeInTheDocument();
Expand All @@ -24,8 +24,8 @@ describe('LineChart', () => {
it('renders multiple lines correctly', () => {
const { container } = render(
<LineChart width={500} height={300} data={mockData}>
<Line dataKey="uv" stroke="#8884d8" />
<Line dataKey="pv" stroke="#82ca9d" />
<Line dataKey="uv" stroke="#8884d8" data={mockData} xScale={(value) => value} yScale={(value) => value} />
<Line dataKey="pv" stroke="#82ca9d" data={mockData} xScale={(value) => value} yScale={(value) => value} />
</LineChart>
);
const paths = container.querySelectorAll('path');
Expand All @@ -35,7 +35,7 @@ describe('LineChart', () => {
it('handles mouse movement for tooltip', () => {
const { container } = render(
<LineChart width={500} height={300} data={mockData}>
<Line dataKey="uv" stroke="#8884d8" />
<Line dataKey="uv" stroke="#8884d8" data={mockData} xScale={(value) => value} yScale={(value) => value} />
</LineChart>
);
const svg = container.querySelector('svg');
Expand All @@ -50,7 +50,7 @@ describe('LineChart', () => {
<LineChart width={500} height={300} data={mockData}>
<XAxis />
<YAxis />
<Line dataKey="uv" stroke="#8884d8" />
<Line dataKey="uv" stroke="#8884d8" data={mockData} xScale={(value) => value} yScale={(value) => value} />
</LineChart>
);
expect(container.querySelector('.y-axis')).toBeInTheDocument();
Expand Down

0 comments on commit 18d2291

Please sign in to comment.