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

   ### Task Summary
   
   `HuggingFaceComponent` sits at codecov ~80% (57 uncovered lines). Goal: 
**cover the file's remaining untested methods to bring its coverage toward 
complete** — it has no browser-only dependency, so every method is 
unit-testable (`HttpClientTestingModule` for the loads, fake timers for the 
debounced search). The groups below are the likely gap; cover whichever the 
spec doesn't already hit. jsdom/Vitest; see `frontend/TESTING.md`.
   
   ### Behavior to add
   
   **HuggingFaceComponent** 
(`frontend/src/app/workspace/component/hugging-face/hugging-face.component.ts`, 
codecov ~80% — EXTEND; cover all remaining untested methods)
   
   - Pagination: `goToPage` / `nextPage` / `prevPage` — assert the page index 
clamps at the bounds and the visible page updates.
   - Task state: `snapshotTaskState` / `restoreTaskState` / `syncTaskSelection` 
/ `resetTaskStateForFirstVisit` / `refreshTaskScopedValidity` / 
`getCurrentTaskTag` — seed a task selection and assert snapshot → restore 
round-trips and the task-scoped validity flag.
   - Selection + field: `onModelSelected` / `onTaskSelected` / 
`persistTaskSelection` — assert the selection is persisted; `readFieldValue` / 
`writeFieldValue` — round-trip the formly field value.
   - Loading: `loadAllModels` / `loadTasks` / `retryLoad` / `retryTasksLoad` — 
assert the HTTP request (via `HttpTestingController`) and that success 
populates the lists / failure sets the retry state (flush synchronously).
   - Search: `onSearchInput` / `clearSearch` — driving `setupServerSearch` (a 
`debounceTime(300)` + `switchMap` stream). Use `vi.useFakeTimers()` (or 
`fakeAsync`) to advance past the 300 ms debounce deterministically; never rely 
on real time. Restore timers in `afterEach`.
   
   ### 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