Skip to content

[YW-357] Testing modals and tables#16

Merged
sherryy021229-sys merged 2 commits intomainfrom
YW-357
Oct 22, 2025
Merged

[YW-357] Testing modals and tables#16
sherryy021229-sys merged 2 commits intomainfrom
YW-357

Conversation

@sherryy021229-sys
Copy link
Collaborator

Testing modals and tables

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-event from 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 the typeof check if preventDefault is 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.

@sherryy021229-sys sherryy021229-sys merged commit 32c18cc into main Oct 22, 2025
13 checks passed
Copy link
Owner

@maugus0 maugus0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please squash and merge.

@maugus0 maugus0 deleted the YW-357 branch October 23, 2025 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants