Conversation
Collaborator
Author
|
@nut1414 pls help review |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new end-to-end test scenario for the Admin Credit page, updates the corresponding page object, and modernizes the use of test IDs in both the backend test code and the frontend components.
- Added E2E test scenario in test/e2e/scenarios/test_admin_credit.py
- Introduced a new AdminCreditPage object in test/e2e/pages/admin/admin_credit_page.py
- Updated frontend components and hooks to use toast notifications and revised data-testid attributes
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/scenarios/test_admin_credit.py | Added a new E2E test scenario for admin credit operations |
| test/e2e/pages/admin/admin_credit_page.py | Created a new page object to interact with the admin credit page elements |
| test/e2e/pages/admin/init.py | Exported the new AdminCreditPage |
| frontend/src/pages/Admin/AdminCreditPage.tsx | Updated test IDs; removed inline error/success messages; integrated new test IDs |
| frontend/src/hooks/Admin/useAdminCredit.ts | Replaced state-based error/success messages with toast notifications |
| frontend/src/components/Common/Dropdown.tsx | Enhanced test ID handling using the new useTestId hook |
Comments suppressed due to low confidence (2)
test/e2e/pages/admin/admin_credit_page.py:21
- The test ID pattern in this method expects an element ending with '-option-button', but the frontend now provides IDs in the format 'admin-credit-option-{amount}'. Consider updating the lambda to use the correct test ID.
self.get_credit_option = lambda amount: page.get_by_test_id(f"admin-credit-option-{amount}-option-button")
frontend/src/pages/Admin/AdminCreditPage.tsx:56
- The data-testid 'admin-credits' is assigned to multiple elements (the Dropdown and the InputField), which may lead to ambiguity during tests. Use distinct identifiers for each element to avoid potential conflicts.
data-testid="admin-credits"
nut1414
approved these changes
Apr 30, 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.
UwU