Add Vitest + React Testing Library setup for viewer-frontend #63
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "test/viewer-frontend-vitest-setup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
viewer-frontend: Vitest (jsdom env) + React Testing Library + jest-dom matchers, viavitest.config.ts/vitest.setup.ts.matchMedia,ResizeObserver, pointer capture,offsetParent).lib/__tests__/utils.test.ts—cn()class merging,isValidEmail()edge caseslib/__tests__/photo-utils.test.ts—isUrl,isVideo,getImageSrc,getVideoSrc,getWebPlaybackStreamUrlhooks/__tests__/useFocusTrap.test.tsx— focus entry, Tab/Shift+Tab wrapping, focus restoration on deactivationcomponents/__tests__/ThemeToggle.test.tsx— accessible labels/aria-pressed for both themes, click toggling (mocksnext-themes)npm test,npm run test:watch,npm run test:coverage.viewer-frontend/README.md.Scope note: intentionally avoided touching files with in-flight uncommitted changes (
IdleLogoutHandler.tsx,SessionProviderWrapper.tsx,verify-email/route.ts,.gitea/workflows/ci.yml) to not collide with concurrent work. No CI job wires upnpm testyet — recommend adding one onceci.ymlsettles.Test plan
npm test— 46/46 passing locallynpx tsc --noEmit— cleannpm testfor viewer-frontend (follow-up)