From 174b9aa7c6b00c9ea95a2ac6dd40686ac05a3ba0 Mon Sep 17 00:00:00 2001 From: Leena Catherine H <25cs345@stjosephs.ac.in> Date: Fri, 9 Oct 2026 22:46:54 +0530 Subject: [PATCH] Fix Missing vi Import in App Component Tests --- src/__tests__/App.test.jsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/__tests__/App.test.jsx b/src/__tests__/App.test.jsx index 51edfcc..b4a3462 100644 --- a/src/__tests__/App.test.jsx +++ b/src/__tests__/App.test.jsx @@ -1,10 +1,12 @@ -import { describe, it, expect } from 'vitest'; -import { render, screen } from '@testing-library/react'; +import { describe, it, expect, vi } from 'vitest'; +import { render } from '@testing-library/react'; import App from '../App'; // Mock heavy map/chart dependencies vi.mock('react-leaflet', () => ({ - MapContainer: ({ children }) =>
{children}
, + MapContainer: ({ children }) => ( +
{children}
+ ), TileLayer: () =>
, Marker: () =>
, Popup: ({ children }) =>
{children}
, @@ -12,7 +14,9 @@ vi.mock('react-leaflet', () => ({ })); vi.mock('recharts', () => ({ - LineChart: ({ children }) =>
{children}
, + LineChart: ({ children }) => ( +
{children}
+ ), Line: () =>
, XAxis: () =>
, YAxis: () =>
, @@ -29,7 +33,6 @@ vi.mock('recharts', () => ({ describe('App', () => { it('renders without crashing', () => { - // App already contains its own BrowserRouter — render directly render(); expect(document.body).toBeTruthy(); });