test(frontend): add unit tests for AdminUserService#6467
Conversation
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6467 +/- ##
============================================
+ Coverage 70.20% 70.27% +0.06%
Complexity 3390 3390
============================================
Files 1142 1142
Lines 44844 44871 +27
Branches 4949 4955 +6
============================================
+ Hits 31484 31534 +50
+ Misses 11725 11701 -24
- Partials 1635 1636 +1
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/request-review @mengw15 |
There was a problem hiding this comment.
Pull request overview
Adds a new frontend unit test spec to cover AdminUserService’s HTTP wiring (URLs, methods, request bodies, and user_id query param usage) using Angular’s HttpClientTestingModule.
Changes:
- Added
admin-user.service.spec.tswith request-shape assertions for the user list/update/add endpoints. - Added request-shape assertions for per-user “quota/statistics” GET endpoints (including which ones include
user_idas a query param). - Added a DELETE test for the per-execution collection endpoint.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| req.flush({}); | ||
| }); | ||
|
|
||
| it("getUploadedFiles() sends the uid as a user_id query param", () => { |
There was a problem hiding this comment.
Not blocking — a note on the three methods this and the two tests below pin: getUploadedFiles, getCreatedDatasets, and getAccessFiles are orphaned dead code calling endpoints that no longer exist. AdminUserResource (/admin/user) only defines list / update / add / created_workflows / access_workflows / user_quota_size / deleteCollection; a repo-wide search finds no uploaded_files or access_files route anywhere (created_datasets exists only under the session-scoped /quota resource); and no frontend component calls any of the three — calling them would 404. They were live once, but #2781 (Remove File-Related Components) deleted their callers and backend routes and left the service methods behind. Since HttpTestingController intercepts everything, these tests stay green while the methods themselves are unusable.
Same situation as #6289/#6305: consider dropping these three tests and deleting the three methods (+ URL constants) in a follow-up instead of cementing them. The other eight tests all target real routes and look good.
What changes were proposed in this PR?
Any related issues, documentation, discussions?
Closes: #6455
How was this PR tested?
cd frontend && npx nx test gui --include="**/admin-user.service.spec.ts", expect 11 passed.yarn test:ci, selected by the auto-appliedfrontendlabel.Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.8 in compliance with ASF