Initial commit

This commit is contained in:
2025-10-16 17:04:52 -05:00
commit 039d51c4e5
45 changed files with 6939 additions and 0 deletions

43
frontend/src/App.test.js Normal file
View File

@@ -0,0 +1,43 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';
// Mock the AuthContext
jest.mock('./contexts/AuthContext', () => ({
useAuth: () => ({
user: null,
loading: false,
login: jest.fn(),
register: jest.fn(),
logout: jest.fn(),
fetchUser: jest.fn()
}),
AuthProvider: ({ children }) => children
}));
// Mock react-router-dom
jest.mock('react-router-dom', () => ({
BrowserRouter: ({ children }) => <div>{children}</div>,
Routes: ({ children }) => <div>{children}</div>,
Route: ({ children }) => <div>{children}</div>,
Navigate: ({ to }) => <div data-testid="navigate">{to}</div>,
Outlet: () => <div data-testid="outlet">Outlet</div>
}));
// Mock react-query
jest.mock('react-query', () => ({
QueryClient: jest.fn(() => ({})),
QueryClientProvider: ({ children }) => <div>{children}</div>
}));
// Mock react-hot-toast
jest.mock('react-hot-toast', () => ({
Toaster: () => <div data-testid="toaster">Toaster</div>
}));
describe('App', () => {
it('renders without crashing', () => {
render(<App />);
expect(screen.getByTestId('toaster')).toBeInTheDocument();
});
});