mengw15 opened a new issue, #7467:
URL: https://github.com/apache/texera/issues/7467

   ### Task Summary
   
   `HuggingFaceImageUploadComponent`'s **template** is at ~39% 
(`hugging-face-image-upload.component.html`, 11 uncovered lines of 51) while 
its class file is already at **100%** — the handlers are unit-tested, but the 
preview panel never renders, so its bindings stay uncovered. Bring the template 
to full coverage. Vitest/jsdom; see `frontend/TESTING.md`.
   
   ### Behavior to add
   
   Extend `hugging-face-image-upload.component.spec.ts` so the preview branch 
renders, then run the coverage report and cover the remaining red lines. The 
gap is the selected-image panel: the `<img [src]="previewSrc">`, the 
`hf-image-meta` block with `{{ displayFileName || "Selected image" }}`, and the 
`(click)="clearImage(fileInput)"` button.
   
   Approach:
   - Put the component in the "image selected" state (set `previewSrc` / 
`displayFileName` through the same path the component uses) and 
`fixture.detectChanges()` so the preview panel renders.
   - Assert the `img`'s bound `src` and the displayed name, plus the fallback 
text when `displayFileName` is empty ("Selected image").
   - Click the clear button via `fixture.debugElement.query(By.css("..."))` + 
`.triggerEventHandler("click", ...)` and assert `clearImage` reset the preview 
state (the panel disappears after a further `detectChanges()`).
   
   Assert on rendered attributes/text — not on layout or geometry (zeros under 
jsdom).
   
   ### Task Type
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [x] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other
   


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