-
Notifications
You must be signed in to change notification settings - Fork 78
chore(FR-1876): add test code for FR-1876 #4953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: fix_FR-1876_/remove-unnecessary-filter
Are you sure you want to change the base?
chore(FR-1876): add test code for FR-1876 #4953
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 5.12% (+0.21% 🔼) |
614/11988 |
| 🔴 | Branches | 4.68% (+0.2% 🔼) |
394/8425 |
| 🔴 | Functions | 2.83% (+0.08% 🔼) |
104/3676 |
| 🔴 | Lines | 4.95% (+0.21% 🔼) |
580/11706 |
Test suite run success
181 tests passing in 14 suites.
Report generated by 🧪jest coverage report action from c0b06fb
nowgnuesLee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add copilot as a reviewer
c688cb2 to
bb801ea
Compare
c777403 to
4162ce2
Compare
There was a problem hiding this 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 the MyResourceWithinResourceGroup component and fixes an import path inconsistency. The tests validate the component's behavior across various resource usage scenarios including normal usage, zero usage, high usage, Infinity values, and edge cases like missing GPU resources or undefined values.
Key Changes:
- Fixed import path from absolute (
src/hooks) to relative (../hooks), aligning with the standard pattern used in the components directory - Added 7 distinct test scenarios covering edge cases and different resource allocation states
- Implemented comprehensive mocking for all dependencies including React Query, i18n, Ant Design components, and custom hooks
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| react/src/components/MyResourceWithinResourceGroup.tsx | Changed import from absolute to relative path for useFetchKey hook, maintaining consistency with other component files |
| react/src/components/MyResourceWithinResourceGroup.test.tsx | Added comprehensive test suite with 7 test cases covering various resource usage scenarios, edge cases, and component rendering validation |
bb801ea to
7328670
Compare
ironAiken2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7328670 to
c1fd1cb
Compare
4162ce2 to
d43b6ed
Compare
|
Oops, I forgot submitting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
c1fd1cb to
c0b06fb
Compare
ironAiken2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM


Add comprehensive tests for MyResourceWithinResourceGroup component
Resolves #4952 (FR-1876)
This PR adds comprehensive test coverage for the
MyResourceWithinResourceGroupcomponent. The tests cover various resource usage scenarios including:The PR also fixes an import path in the component file, changing from an absolute import to a relative import for the
useFetchKeyhook.Checklist:
backend.ai-webui/reactand runpnpm run test