Phase 2: Language Context & Selector - Add language dropdown to Header and auth pages
- Create LanguageSelector component with dropdown (shows flag + name) - Add LanguageSelector to Header (right side, near user email/logout) - Add LanguageSelector to login, signup, and signup/[code] pages - Create test-utils.tsx with renderWithProviders helper - Add vitest.setup.ts to mock localStorage - Update all test files to use renderWithProviders - Language selector persists choice in localStorage - HTML lang attribute updates dynamically based on selected language All frontend and e2e tests passing.
This commit is contained in:
parent
f7553df05d
commit
f86ec8b62d
11 changed files with 214 additions and 37 deletions
16
frontend/app/test-utils.tsx
Normal file
16
frontend/app/test-utils.tsx
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { ReactElement } from "react";
|
||||
import { render, RenderOptions } from "@testing-library/react";
|
||||
import { Providers } from "./components/Providers";
|
||||
import { AuthProvider } from "./auth-context";
|
||||
|
||||
function AllProviders({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<Providers>
|
||||
<AuthProvider>{children}</AuthProvider>
|
||||
</Providers>
|
||||
);
|
||||
}
|
||||
|
||||
export function renderWithProviders(ui: ReactElement, options?: Omit<RenderOptions, "wrapper">) {
|
||||
return render(ui, { wrapper: AllProviders, ...options });
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue