Skip to content

[YW-359] Testing admin services and utils#17

Merged
sherryy021229-sys merged 3 commits intomainfrom
YW-359
Oct 22, 2025
Merged

[YW-359] Testing admin services and utils#17
sherryy021229-sys merged 3 commits intomainfrom
YW-359

Conversation

@sherryy021229-sys
Copy link
Collaborator

Testing admin services and utils

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 adds comprehensive test coverage for admin services, utilities, and components. It introduces over 40 new test files covering status utilities, permissions, formatters, export utilities, constants, and multiple admin services (user, settings, review, report, ranking, novel, mock API, library, auth, analytics, dashboard, comment, chapter, and category services), as well as table components and modals.

Key Changes

  • Added extensive test coverage for admin utility functions (status, permissions, formatters, export, constants)
  • Implemented comprehensive service layer tests with axios mocking and interceptor testing
  • Added component tests for tables (DataTable, TableFilters, ExportButton, ColumnSelector, BulkActions) and modals (ViewModal, SuspendUserModal)
  • Updated package.json to move @testing-library/user-event to devDependencies and upgrade to v14.6.1, added babel-jest v30.2.0

Reviewed Changes

Copilot reviewed 40 out of 43 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/utils/admin/statusutils.test.js Tests for status utility functions including config retrieval, badge/tag props, transitions, statistics, filtering, sorting, and formatting
src/utils/admin/permissions.test.js Tests for permission checking, role hierarchy, action authorization, and menu filtering
src/utils/admin/formatters.test.js Tests for various formatting utilities (currency, percentage, dates, relative time, duration, phone, etc.)
src/utils/admin/exportutils.test.js Tests for CSV/Excel/JSON export functionality and validation
src/utils/admin/constants.test.js Tests for constant definitions and configuration values
src/services/admin/*.test.js Comprehensive service layer tests with axios mocking and interceptor testing
src/components/admin/tables/*.test.jsx Component tests for table-related components
src/components/admin/modals/*.test.jsx Component tests for modal components
package.json Dependency updates for testing libraries

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sherryy021229-sys sherryy021229-sys merged commit d873b1e into main Oct 22, 2025
13 checks passed
@maugus0 maugus0 deleted the YW-359 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.

3 participants