Add comprehensive tests for client validation, revenue and expense categories, invoice generation, and schemas

- Implement tests for client validation functions including tax ID, VAT ID, IBAN, BIC, website, and company form validation.
- Create tests for revenue and expense categories ensuring all expected categories and labels are present.
- Add tests for invoice number generation with various scenarios including prefix handling and sequence padding.
- Introduce tests for default categories and their integration, ensuring no overlaps and consistent naming conventions.
- Implement Zod schema validation tests for currency, tax rates, IBAN, tax ID, VAT ID, invoices, companies, and customers.
- Add utility tests for tax calculations, including item amounts and invoice totals, ensuring correct handling of tax rates and formatting.
- Set up Vitest configuration and global test setup for consistent testing environment.
This commit is contained in:
hwinkel
2026-05-08 16:03:05 +02:00
parent 586d5b2cc8
commit db953b1e28
18 changed files with 3370 additions and 19 deletions
+11 -1
View File
@@ -10,6 +10,10 @@
"start": "react-router-serve ./build/server/index.js",
"typecheck": "react-router typegen && tsc",
"lint": "eslint",
"test": "vitest run",
"test:watch": "vitest",
"test:ui": "vitest --ui",
"test:coverage": "vitest run --coverage",
"db:migrate": "prisma migrate dev",
"db:seed": "npx ts-node --compiler-options '{\"module\":\"CommonJS\"}' prisma/seed.ts",
"db:studio": "prisma studio",
@@ -54,15 +58,21 @@
"devDependencies": {
"@react-router/dev": "^7.13.1",
"@tailwindcss/postcss": "^4",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@types/node": "^20",
"@types/node-cron": "^3.0.11",
"@types/react": "^19",
"@types/react-dom": "^19",
"@vitejs/plugin-react": "^4",
"@vitest/coverage-v8": "^4.1.5",
"@vitest/ui": "^4.1.5",
"eslint": "^9",
"jsdom": "^29.1.1",
"tailwindcss": "^4",
"typescript": "^5",
"vite": "^6",
"vite-tsconfig-paths": "^5"
"vite-tsconfig-paths": "^5",
"vitest": "^4.1.5"
}
}