feat: add comprehensive tests for UI components, hooks, and API interactions

- Implement tests for Pagination, StatusBadge, ConfirmDialog, and MobileInput components.
- Add tests for useSubscription, usePaymentConfig, and usePwaInstall hooks.
- Create tests for API requests in the api module, including success and error handling.
- Add utility function tests for formatting and validating Iranian mobile numbers.
- Implement tests for BlogFormPage and BlogsPage to validate form submissions and data fetching.
- Add tests for LoginPage to ensure proper validation and state management.
- Create tests for authStore and uiStore to validate state management and functionality.
- Set up Vitest configuration and testing utilities for consistent testing environment.
This commit is contained in:
hamed
2026-06-28 22:58:15 +03:30
parent 439bb0868e
commit 6084dc5d6b
15 changed files with 2083 additions and 2146 deletions
+12 -1
View File
@@ -9,15 +9,23 @@
"@symfony/ux-react": "file:vendor/symfony/ux-react/assets",
"@symfony/webpack-encore": "^6.0.0",
"@tailwindcss/postcss": "^4.0.0",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@vitejs/plugin-react": "^4",
"core-js": "^3.38.0",
"jsdom": "^29.1.1",
"postcss": "^8.0.0",
"postcss-loader": "^8.0.0",
"regenerator-runtime": "^0.13.9",
"tailwindcss": "^4.0.0",
"ts-loader": "^9.6.0",
"typescript": "^5.0.0",
"vite-tsconfig-paths": "^6.1.1",
"vitest": "^2",
"webpack": "^5.72",
"webpack-cli": "^6.0.0"
},
@@ -50,6 +58,9 @@
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
"build": "encore production --progress",
"test": "vitest run",
"test:watch": "vitest",
"test:cov": "vitest run --coverage"
}
}