mengw15 opened a new pull request, #7418:
URL: https://github.com/apache/texera/pull/7418
### What changes were proposed in this PR?
Extends `user-project-list-item.component.spec.ts` to render the template
branches
the existing class-focused tests never reached, taking
`user-project-list-item.component.html` from ~51% to 100% (110/110). 13 new
tests:
- **colour picker** — the `[(colorPicker)]` / `(colorPickerSelect)` outputs,
and
the `cpExtraTemplate` menu that only exists while the panel is open: its
Save
action, and its Delete action in both states (disabled while the project
has no
colour, enabled and wired once one is set).
- **name** — the edit button swaps the link for the `#editingProject` input,
whose
`keyup.enter` saves and whose `focusout` leaves edit mode.
- **description** — expand renders the `<markdown>` body and the collapse
control,
collapse hides them again; the edit button swaps in the textarea, whose
suffix
save icon appears only once the draft differs from the saved text, and
whose
`focusout` saves.
- **actions** — the share button, the delete popconfirm's `nzOnConfirm`, the
read-only `[disabled]` branch, and the `*ngIf="editable"` branch that
hides the
edit controls and the whole action list.
- three class-level gaps the template work made reachable: the `entry`
getter's
guard, `ngOnInit` adopting a stored colour, and `updateProjectColor`
skipping the
service when the colour is unchanged (class 63/67 -> 66/67).
Interactions go through the DOM (`By.css` + `triggerEventHandler`).
`MarkdownService`
is stubbed the way the sibling dashboard specs stub it, so the expanded
description
never depends on the real markdown pipeline. Per the issue, the creation
time is
rendered but its formatted value is not asserted — only the `Created:`
label, which
is timezone-stable. No production code was changed.
One statement stays uncovered: the `if (!this.entry) throw` guard inside
`saveProjectName`'s subscribe. The `entry` getter already throws when no
entry was
provided, so that branch cannot be reached — it is dead code rather than a
coverage
gap, and removing it felt out of scope for a test-only PR.
### Any related issues, documentation, discussions?
Closes #7410.
### How was this PR tested?
`ng test --watch=false --include
src/app/dashboard/component/user/user-project/user-project-list-item/user-project-list-item.component.spec.ts`
— 23 passed (10 existing + 13 new), run 3x for determinism. Coverage
(`--coverage`)
confirms `user-project-list-item.component.html` at 110/110 and the class at
66/67.
The failure path was verified by breaking an assertion (red, non-zero exit);
eslint
and prettier are 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]