mengw15 opened a new pull request, #6538:
URL: https://github.com/apache/texera/pull/6538
### What changes were proposed in this PR?
Extends the existing `UserProjectListItemComponent` spec (which only had a
`should create` test; codecov ~43%) to cover the previously-untested action
methods, adding 9 tests. `UserProjectService` (already provided real via the
`HttpClientTestingModule` setup) is `vi.spyOn`-stubbed per test:
- **`updateProjectColor`** — persists a valid HEX color and updates local
state;
rejects an invalid HEX (notifies error, no service call); no-ops when the
item
is not editable.
- **`removeProjectColor`** — deletes the color and resets `color` /
`entry.color`.
- **`saveProjectName`** — persists a changed name; no service call when
unchanged.
- **`saveProjectDescription`** — persists a changed description and notifies
success; no service call when unchanged.
- **`onClickOpenShareAccess`** — opens the share-access modal with the
expected
`nzContent` / `nzData`, and emits `refresh` when the modal closes.
Also clones the shared `testProject` fixture into the host per test
(`entry = { ...testProject }`), since `saveProjectName` /
`saveProjectDescription`
mutate `entry` in place and would otherwise leak state across tests.
No production code was changed.
### Any related issues, documentation, discussions?
Closes #6534
### 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/user/user-project/user-project-list-item/user-project-list-item.component.spec.ts
# Tests 10 passed (10)
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])
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]