diff --git a/frontend/src/App.test.tsx b/frontend/src/App.test.tsx index 7eb9e153..574915db 100644 --- a/frontend/src/App.test.tsx +++ b/frontend/src/App.test.tsx @@ -3,6 +3,7 @@ import '@testing-library/jest-dom'; import { describe, it, expect, vi, beforeEach } from 'vitest'; import { BrowserRouter } from 'react-router-dom'; import App from './App'; +import { FilesProvider } from './contexts/FilesContext'; // Mock the imports vi.mock('./components/AppHeader/AppHeader.tsx', () => ({ @@ -29,7 +30,9 @@ describe('App component', () => { const renderComponent = () => { render( - + + + ); }; diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 32201b91..31b3daa8 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -8,10 +8,12 @@ import { TemplatesIndex } from "./components/TemplatesIndex/TemplatesIndex.tsx"; import Comment from './assets/comment.svg'; import CSV from './assets/csv.svg'; import "./App.scss"; +import { useFiles } from "./contexts/FilesContext.tsx"; function App() { const { pathname } = useLocation(); const navigate = useNavigate(); + const { setFiles } = useFiles(); const [isFirstVisit, setIsFirstVisit] = useState(false); useEffect(() => { @@ -20,6 +22,7 @@ function App() { setIsFirstVisit(true); localStorage.setItem("hasVisited", "true"); } + setFiles([]); }, []); const navLinks = [