[YW-360] Upgrade the test coverage#19
Merged
sherryy021229-sys merged 4 commits intomainfrom Oct 23, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades test coverage across multiple admin pages and components by adding new test cases, removing placeholder tests, and improving test implementation quality. The changes focus on enhancing coverage for user management, yuan statistics, category management, novels moderation, and various hooks.
Key changes:
- Added comprehensive test coverage for readers page filters, pagination, and bulk actions
- Enhanced yuan and yuan statistics tests with totals computation, mixed data shapes, and navigation scenarios
- Expanded category form and index tests with validation, error handling, and custom actions
- Improved novels moderation tests covering action flows, loading states, and error scenarios
- Added extensive coverage for useSearch and useExport hooks
- Removed placeholder/dummy test files across multiple modules
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/admin/yuan/yuanstatistics.test.jsx | Added tests for header/navigation, totals computation, mixed data shapes, and table pagination |
| src/pages/admin/yuan/test.jsx | Removed placeholder test file |
| src/pages/admin/yuan/index.test.jsx | Removed duplicate header tests, added tests for mixed response shapes and row keys |
| src/pages/admin/users/writers-columns.test.jsx | Removed unused imports and join date column test |
| src/pages/admin/users/readers.test.jsx | Enhanced mock interactivity, added comprehensive filter/pagination/bulk action tests |
| src/pages/admin/users/readers-columns.test.jsx | Removed unused imports and join date column test |
| src/pages/admin/settings/test.jsx | Removed placeholder test file |
| src/pages/admin/novels/test.jsx | Removed placeholder test file |
| src/pages/admin/novels/moderate.test.jsx | Improved table mock to render columns, added action coverage tests |
| src/pages/admin/library/test.jsx | Removed placeholder test file |
| src/pages/admin/dashboard/test.jsx | Removed placeholder test file |
| src/pages/admin/comments/test.jsx | Removed placeholder test file |
| src/pages/admin/chapters/test.jsx | Removed placeholder test file |
| src/pages/admin/categories/test.jsx | Removed placeholder test file |
| src/pages/admin/categories/index.test.jsx | Added tests for custom navigation actions and toggle status error handling |
| src/pages/admin/categories/categoryform.test.jsx | Comprehensive rewrite with validation, loading states, and error scenarios |
| src/pages/admin/categories/categories.test.jsx | Removed placeholder test file |
| src/index.test.js | Added mocks for react-dom/client, antd, and App component |
| src/hooks/admin/usesearch.test.js | Added extensive coverage for search flow, history, suggestions, filtering, and utilities |
| src/hooks/admin/useexport.test.js | Complete rewrite with end-to-end tests for converters, download, and export flows |
| src/components/admin/modals/editmodal.test.jsx | Enhanced validation failure test with console.error spy |
| src/App.test.js | Added comprehensive routing tests for all admin pages |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
phutruonnttn
approved these changes
Oct 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
upgrade the test coverage