The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-6526-8d7664d288ddb5bfd7816a1dc6eb8d2df893a7c3
 has succeeded.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).

Head commit for run:
5762b8b380b5c95f2b34f116253605c02572cd3a / Meng Wang <[email protected]>
test(frontend): extend AdminUserComponent unit test coverage (#6526)

### What changes were proposed in this PR?

Extends the existing Vitest spec for `AdminUserComponent`

(`frontend/src/app/dashboard/component/admin/user/admin-user.component.ts`,
codecov ~42%). The existing spec only covered creation and the
email/comment
search helpers; this adds 13 tests for the previously-untested methods.

The shared `TestBed` setup now mocks `AdminUserService` and
`FeedbackService`
(instead of the real services over `HttpClientTestingModule`), which
keeps
`ngOnInit` deterministic and lets the new tests assert service
interactions
directly. The eight existing tests are unchanged and still pass.

New behavior covered:

- **`addUser`** — calls the service and reloads the list (re-runs
`ngOnInit`).
- **inline-edit lifecycle** — `startEdit` loads a row's values;
`saveEdit`
persists a change (and updates the local lists), no-ops when nothing
changed,
and surfaces a service error via the message service; `stopEdit` clears
the
edit target; `reset` clears search state and restores the display list.
- **`updateRole`** — edits only the role and persists it.
- **display helpers** — `isUserActive` (recent-login window) and
  `getAccountCreation` (seconds → ms, default 0).
- **feedback / quota** — `loadFeedbackCounts` + `getFeedbackCount`
caching;
`clickToViewFeedbacks` and `clickToViewQuota` open the correct modal
content.

No production code was changed.

### Any related issues, documentation, discussions?

Closes #6518

### How was this PR tested?

Extended unit tests, run locally in `frontend/` (all green; the failure
path was
verified by breaking an assertion to confirm the suite goes red):

```
ng test --watch=false --include 
src/app/dashboard/component/admin/user/admin-user.component.spec.ts
# Tests  21 passed (21)   (8 existing + 13 new)
eslint <spec>       # clean
prettier --check    # clean
```

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

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

Report URL: https://github.com/apache/texera/actions/runs/29665937489

With regards,
GitHub Actions via GitBox

Reply via email to