Skip to content

test(frontend): extend AdminUserComponent unit test coverage#6744

Merged
aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:test-fe-admin-user
Jul 22, 2026
Merged

test(frontend): extend AdminUserComponent unit test coverage#6744
aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:test-fe-admin-user

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Extends admin-user.component.spec.ts covering the user-admin actions (add/edit/save/delete, role changes, sort/filter) and their notification/error branches. Coverage 75% -> high. No existing tests modified.

Any related issues, documentation, discussions?

Closes #6737.

How was this PR tested?

ng test --include='**/admin-user.component.spec.ts' -> 40/40 passing. yarn format:ci passes.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.8 [1M context])

Add tests for the user-admin actions (add/edit/save/delete, role changes,
sort/filter) and their notification/error branches. Coverage 75% -> high.
Copilot AI review requested due to automatic review settings July 22, 2026 02:43
@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @mengw15
    You can notify them by mentioning @mengw15 in a comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extends the Angular unit test coverage for AdminUserComponent (admin user management UI) by adding additional spec cases for edit focus behavior, error handling, searching, sorting, and role filtering—aligning with Issue #6737’s goal of covering user-admin actions and their branches.

Changes:

  • Add fakeAsync/tick-based tests to cover startEdit’s setTimeout focus + caret placement behavior.
  • Add additional negative/error-path coverage (e.g., saveEdit error fallback to err.message) and null-tolerance coverage for search helpers.
  • Add direct unit coverage for sort comparator and role filter functions (tie-breakers, missing values, active/inactive ordering).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/app/dashboard/component/admin/user/admin-user.component.spec.ts Outdated
@aglinxinyuan
aglinxinyuan requested a review from mengw15 July 22, 2026 02:46
@codecov-commenter

codecov-commenter commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.19%. Comparing base (368227a) to head (2dcac8a).
⚠️ Report is 26 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6744      +/-   ##
============================================
+ Coverage     74.85%   75.19%   +0.34%     
  Complexity     3447     3447              
============================================
  Files          1160     1160              
  Lines         45793    45795       +2     
  Branches       5069     5070       +1     
============================================
+ Hits          34278    34437     +159     
+ Misses         9868     9748     -120     
+ Partials       1647     1610      -37     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 10c820e
agent-service 76.76% <ø> (ø) Carriedforward from 10c820e
amber 67.20% <ø> (ø) Carriedforward from 10c820e
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from 10c820e
config-service 66.66% <ø> (ø) Carriedforward from 10c820e
file-service 66.80% <ø> (ø) Carriedforward from 10c820e
frontend 79.40% <ø> (+0.78%) ⬆️
notebook-migration-service 78.94% <ø> (ø) Carriedforward from 10c820e
pyamber 92.08% <ø> (ø) Carriedforward from 10c820e
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from 10c820e

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mengw15 mengw15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

startEdit uses setTimeout(0) (a macrotask); rename the test to reflect the
timer-based behavior accurately.
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 22, 2026
@aglinxinyuan
aglinxinyuan removed this pull request from the merge queue due to a manual request Jul 22, 2026
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jul 22, 2026
@aglinxinyuan aglinxinyuan reopened this Jul 22, 2026
@aglinxinyuan
aglinxinyuan enabled auto-merge July 22, 2026 18:44
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 22, 2026
@aglinxinyuan
aglinxinyuan removed this pull request from the merge queue due to a manual request Jul 22, 2026
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 22, 2026
@aglinxinyuan
aglinxinyuan removed this pull request from the merge queue due to a manual request Jul 22, 2026
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 22, 2026
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 22, 2026
Merged via the queue into apache:main with commit b248206 Jul 22, 2026
44 checks passed
@aglinxinyuan
aglinxinyuan deleted the test-fe-admin-user branch July 22, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend AdminUserComponent unit test coverage

4 participants