aglinxinyuan opened a new pull request, #7408:
URL: https://github.com/apache/texera/pull/7408

   ### What changes were proposed in this PR?
   
   The browse section's specs cover the route map and the cover-URL cache, but 
no card had ever been rendered, so every per-entity binding and fallback in the 
template was unpinned. The template was at roughly **8%** of statements locally.
   
   Adds 8 tests over what the template decides on its own:
   
   - the section disappears entirely when it holds no entities
   - the heading, and one card per entity, with name and description
   - `{{ entity.description || 'No description available' }}` — an entity 
published without a description would otherwise render an empty paragraph and 
collapse the card
   - `[src]="getCoverImage(entity)"` and the inline `(error)` handler that 
swaps in `defaultBackground`; a cached cover URL can still 404, and that 
handler is the only thing standing between the user and a broken image
   - the avatar labelled with the entity id, and the owner name defaulting to 
empty
   
   **Verified by mutation**, all reverted (template diff empty):
   
   | Mutation | Result |
   |---|---|
   | render the section even when empty | red |
   | drop the description fallback | red |
   | drop the owner-name fallback | red |
   | ignore the cover cache and always use the default | red |
   | remove the image error handler | red |
   | label the avatar with the name instead of the id | red |
   | show the description as the card title | red |
   | render only the first entity | red |
   
   Local coverage for the component directory: **~8% → 94.73%** of statements.
   
   The real `UserService` is replaced with the shared `StubUserService`: the 
embedded `texera-user-avatar` injects it, and the real one drags in 
`AuthService` and from there `JwtHelperService` and `NzModalService`. The stub 
cuts that chain in one step.
   
   No production file is touched.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7405
   
   ### How was this PR tested?
   
   ```
   npx ng test --watch=false --include="**/browse-section.component.spec.ts"
   ```
   
   ```
    Test Files  1 passed (1)
         Tests  17 passed (17)
   ```
   
   8 new on top of the existing 9. `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