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
+19
View File
@@ -0,0 +1,19 @@
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
plugins: [react(), tsconfigPaths()],
test: {
environment: "jsdom",
globals: true,
setupFiles: ["./vitest.setup.ts"],
include: ["tests/**/*.test.ts", "tests/**/*.test.tsx"],
coverage: {
provider: "v8",
reporter: ["text", "json", "html"],
include: ["app/lib/**/*.ts", "app/lib/**/*.tsx"],
exclude: ["app/lib/**/*.server.ts"],
},
},
});