Some checks failed
95 tests across 22 files covering all frontend modules: - API layer: client, auth - Components: BondDetails, Layout, PriceChart, ProtectedRoute, SearchBar, StockDetails - Context: AuthContext - Hooks: useAuth, useBond, useBondCandles, useSearch, useStock, useStockCandles, useStockDividends - Pages: BondPage, HomePage, LoginPage, ProfilePage, RegisterPage, StockPage Infrastructure: - vitest + @testing-library/react + MSW v2 with 13 API handlers - Co-located test files alongside source files - Test utilities: setup, server, factories, test-utils - BrowserRouter future flags for MemoryRouter test compatibility - Root test:frontend script for workspace-wide execution
358 B
358 B
Tests
Common issues
Auth loading screen
Components rendered through renderWithProviders are wrapped in AuthProvider which shows
a loading screen until POST /api/v1/auth/refresh resolves.
- Use
await screen.findByText()to wait for auth to complete. - For components that don't need auth, render with just QueryClientProvider + MemoryRouter.