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

   ### Task Summary
   
   `DatasetDetailComponent`'s **template** is at ~74% but still has the largest 
template gap in the frontend (`dataset-detail.component.html`, 81 uncovered 
lines); the class file is ~83%. Much of the detail view's interactive markup is 
never rendered by the spec, so its bindings stay unexecuted. Bring the template 
to full coverage. Vitest/jsdom; see `frontend/TESTING.md`.
   
   ### Behavior to add
   
   Extend `dataset-detail.component.spec.ts` so each template branch renders, 
then run the coverage report and cover the remaining red lines. The uncovered 
constructs are `(click)` handlers (e.g. `isLogin && toggleLike()`, 
`onEditContributor(contributor)`), `*ngIf` branches, `[(ngModel)]` bindings and 
the cover-image `[src]` binding.
   
   Approach:
   - `fixture.detectChanges()` after each state change — it is the 
template-coverage switch.
   - Render the states the template switches on: logged-in vs logged-out (the 
`isLogin` guard on like), owner vs read-only viewer, with and without a cover 
image, empty vs populated contributor/version lists.
   - Fire the actions through the DOM — 
`fixture.debugElement.query(By.css("..."))` + `.triggerEventHandler("click", 
...)` — and assert the service double (`vi.fn()`) was called, rather than 
calling handlers directly.
   
   Determinism constraints: the component uses `new Date` and a `setTimeout`. 
**Do not assert on any rendered date/time string** (a fixed epoch renders 
differently under a UTC CI runner) — assert element presence or a 
timezone-stable substring. **Do not add `vi.useFakeTimers()` to suppress the 
timeout** — a synchronous test body never runs the callback, and layering fake 
timers over zone.js's patched timers is Node-version dependent and has caused 
CI-only failures. Never assert on layout/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