Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds end‐to‐end test scenarios for the Admin Billing page, updates datetime utilities with additional formatting options, and enhances frontend components with data-testid attributes for better testability.
- Updated datetime utils with new functions (format_date, date_only parameters, month-related formatting).
- Added comprehensive E2E tests for Admin Billing page covering transactions and filtering.
- Enhanced frontend components (AdminBillingPage, RangePicker, BillingStatsVisualizer, etc.) with proper test identifiers and minor UI improvements.
Reviewed Changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/utils/datetime_utils.py | Added new datetime formatting functions and extended existing ones. |
| test/e2e/scenarios/test_admin_billing.py | Introduced multiple E2E test scenarios for admin billing functionality. |
| test/e2e/pages/admin/admin_billing_page.py | Updated locator usage and added test IDs for improved stability. |
| test/e2e/data/models.py | Added models for admin billing data structures. |
| frontend/src/utils/dateTime.ts | Added convertToUTC helper and updated date formatting in hooks. |
| frontend/src/pages/Admin/AdminBillingPage.tsx | Modified rendering of date and instance name with test ID additions. |
| frontend/src/hooks/Admin/useAdminBilling.ts | Updated date handling to convert to UTC before formatting. |
| frontend/src/constant/CurrencyConstant.ts | Revised currency format function. |
| Others (RangePicker, BillingStatsVisualizer, etc.) | Added missing data-testid attributes and refined UI components. |
| backend/src/core/service/admin.py | Modified transaction response to use Bangkok timezone formatted strings. |
| backend/src/core/models/admin.py | Updated admin transaction model datetime fields to string. |
Files not reviewed (2)
- backend/test_certificate/tmp/lxd.crt: Language not supported
- backend/test_certificate/tmp/lxd.key: Language not supported
Collaborator
Author
|
@nut1414 pls help review. i was going to make reusable table action class but it seem to be too much pain, so i gave up lol. |
nut1414
reviewed
Apr 28, 2025
| amount=transaction.amount, | ||
| created_at=transaction.created_at, | ||
| last_updated_at=transaction.last_updated_at | ||
| created_at=DateTimeUtils.to_bkk_string(transaction.created_at), |
Owner
There was a problem hiding this comment.
Why are we changing it back to bkk string again?
Collaborator
Author
There was a problem hiding this comment.
when testing, the time is still in utc somehow so i convert it in the backend, frontend just display it without formatting anything.
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.
Summary
Frontend:
Backend:
Testing: