[YW-357] Testing modals and tables#16
Merged
sherryy021229-sys merged 2 commits intomainfrom Oct 22, 2025
Merged
Conversation
added 2 commits
October 22, 2025 23:53
There was a problem hiding this comment.
Pull Request Overview
This PR replaces placeholder test stubs with comprehensive test implementations for admin tables and modals components. The changes focus on establishing proper test coverage using React Testing Library with mocked Ant Design components.
Key Changes:
- Replaced placeholder tests with full test suites for table components (filters, exports, bulk actions, column selectors)
- Implemented detailed tests for modal components (view, edit, suspend, ban, report, confirm)
- Moved
@testing-library/user-eventfrom dependencies to devDependencies and upgraded to v14.6.1
Reviewed Changes
Copilot reviewed 19 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/admin/tables/tablefilters.test.jsx | Removed placeholder test file |
| src/components/admin/tables/index.test.js | Removed placeholder test file |
| src/components/admin/tables/exportbutton.test.jsx | Removed placeholder test file |
| src/components/admin/tables/datatable.test.jsx | Removed placeholder test file |
| src/components/admin/tables/columnselector.test.jsx | Removed placeholder test file |
| src/components/admin/tables/bulkactions.test.jsx | Removed placeholder test file |
| src/components/admin/tables/test/tablefilters.test.jsx | Added comprehensive tests for table filters with mock Ant Design components |
| src/components/admin/tables/test/index.test.jsx | Added tests for module re-exports |
| src/components/admin/tables/test/exportbutton.test.jsx | Added tests for export functionality with CSV/Excel/JSON formats |
| src/components/admin/tables/test/datatable.test.jsx | Added tests for data table component with selection and column features |
| src/components/admin/tables/test/columnselector.test.jsx | Added tests for column visibility selector with localStorage persistence |
| src/components/admin/tables/test/bulkactions.test.jsx | Added tests for bulk actions including the useBulkActions hook |
| src/components/admin/modals/viewmodal.test.jsx | Replaced placeholder with comprehensive view modal tests |
| src/components/admin/modals/suspendusermodal.test.jsx | Replaced placeholder with suspension modal tests |
| src/components/admin/modals/reportactionmodal.test.jsx | Replaced placeholder with report action tests |
| src/components/admin/modals/editmodal.test.jsx | Replaced placeholder with edit modal validation tests |
| src/components/admin/modals/confirmdialog.test.jsx | Replaced placeholder with dialog and hook tests |
| src/components/admin/modals/banusermodal.test.jsx | Replaced placeholder with ban modal tests including accessibility |
| package.json | Moved user-event to devDependencies and added babel-jest |
Comments suppressed due to low confidence (1)
src/components/admin/tables/test/bulkactions.test.jsx:1
- This comma operator creates a multi-statement side effect. The result of
e.preventDefault()is discarded. Replace with separate statements or remove thetypeofcheck ifpreventDefaultis guaranteed to exist in the test environment.
import React from 'react';
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
phutruonnttn
approved these changes
Oct 22, 2025
maugus0
approved these changes
Oct 22, 2025
Owner
maugus0
left a comment
There was a problem hiding this comment.
LGTM, please squash and merge.
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.
Testing modals and tables