Add tests for useFormError hook and FormField component

- Introduced `useFormError.test.tsx` to validate error handling, server error integration, and form behavior.
- Added `FormField.test.tsx`, covering rendering, accessibility, error handling, and prop forwarding.
- Updated Jest coverage exclusions to include `middleware.ts` (no logic to test).
This commit is contained in:
2025-11-02 17:14:12 +01:00
parent 0e554ef35e
commit ac3fac0426
3 changed files with 567 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ const customJestConfig = {
'!src/app/**', // Next.js app directory - layout/page files (test in E2E)
'!src/**/index.{js,jsx,ts,tsx}', // Re-export index files - no logic to test
'!src/lib/utils/cn.ts', // Simple utility function from shadcn
'!src/middleware.ts', // middleware.ts - no logic to test
],
coverageThreshold: {
global: {