aglinxinyuan opened a new pull request, #7415:
URL: https://github.com/apache/texera/pull/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)
   


-- 
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]

Reply via email to