The GitHub Actions job "Contributor welcome and template check" on 
texera.git/main has succeeded.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).

Head commit for run:
97dac3c2db0055a5bb98a23d6741ace3fc106742 / Xinyuan Lin <[email protected]>
test(frontend): render the project list item's permission and description rules 
(#7415)

### What changes were proposed in this PR?

`UserProjectListItemComponent` decides in its template what a viewer may
touch, and none of it was rendered — the existing specs call the save
and colour methods directly.

Adds 8 tests. The one that matters most is the `editable` gating: a
project the viewer only holds READ on must not be offered the rename,
add-description, share or delete controls, and that decision lives
entirely in two `*ngIf="editable"` guards plus one on the action list.

Also covered: the name/edit-input swap, the description starting
collapsed and expanding on request, the `trim()` guard that stops a
whitespace-only description rendering an empty expander, the character
counter, the save icon appearing only once the text actually differs,
and the creation-date format.

**Verified by mutation**, all reverted (template diff empty):

| Mutation | Result |
|---|---|
| show the rename button to a read-only viewer | red |
| show the share/delete actions to a read-only viewer | red |
| invert the name / edit-input branch | red |
| drop the collapse guard | red |
| drop the whitespace `trim()` guard | red |
| always show the save icon | red |
| count characters against the max instead of the text | red |
| change the creation-date format | red |

Two things worth recording:

- `MarkdownModule.forRoot()` joins the TestBed. An expanded description
renders a `<markdown>` element, and no existing test reached that path,
so `MarkdownService` had never been needed.
- `descriptionCollapsed` defaults to **true**. My first version of the
collapse test asserted the opposite and failed, which also revealed that
the whitespace test would have passed vacuously — collapsed hides the
block regardless. It now expands first, so the `trim()` guard is the
only thing left doing the work.

No production file is touched.

### Any related issues, documentation, discussions?

Closes #7412

### How was this PR tested?

```
npx ng test --watch=false 
--include="**/user-project-list-item.component.spec.ts"
```

```
 Test Files  1 passed (1)
      Tests  18 passed (18)
```

8 new on top of the existing 10. `yarn format:ci` passes.

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

Generated-by: Claude Code (Opus 5)

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

With regards,
GitHub Actions via GitBox

Reply via email to