Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
severynenko committed Aug 14, 2024
2 parents 0714385 + 8710f94 commit be62d80
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/components/charts/ProjectCompletion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const chartConfig = {
export function ProjectCompletion() {
return (
<ChartContainer config={chartConfig}>
<RadarChart
<RadarChart data-testid="radar-chart"
data={chartData}
margin={{
top: -40,
Expand Down
13 changes: 2 additions & 11 deletions src/components/charts/__tests__/ProjectCompletion.test.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Mock ResizeObserver
class ResizeObserver {
observe() {}
unobserve() {}
disconnect() {}
}

global.ResizeObserver = ResizeObserver;

import { render, screen } from "@testing-library/react";
import React from "react";
import { ProjectCompletion } from "../ProjectCompletion";
Expand All @@ -17,8 +8,8 @@ describe("ProjectCompletion Component", () => {
});

it("renders RadarChart component", () => {
const { container } = render(<ProjectCompletion />);
const radarChart = container.querySelector('[data-chart="chart-r1"]');
render(<ProjectCompletion />);
const radarChart = screen.getByTestId("radar-chart");
expect(radarChart).toBeInTheDocument();
});
});
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"noEmit": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"jsx": "react",
"jsx": "preserve",
"plugins": [
{
"name": "next"
Expand Down Expand Up @@ -54,4 +54,4 @@
"exclude": [
"node_modules"
]
}
}

0 comments on commit be62d80

Please sign in to comment.