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

   ### Task Summary
   
   `CardItemComponent`'s **template** is at ~50% (`card-item.component.html`, 
51 uncovered lines) while its class file is already ~96%. The spec exercises 
the class but leaves half the template unrendered. Bring the template to full 
coverage. Vitest/jsdom; see `frontend/TESTING.md`.
   
   ### Behavior to add
   
   Extend `card-item.component.spec.ts` so each template branch renders, then 
run the coverage report and cover the remaining red lines. The uncovered 
constructs are `*ngIf` branches, `(click)` handlers and `[(ngModel)]` bindings 
— for example the selection checkbox (`entry.checked`) and its 
`$event.stopPropagation()` wrapper, and the per-entity-type blocks.
   
   Approach:
   - `fixture.detectChanges()` after each state change (the template-coverage 
switch).
   - Trigger the bindings through the DOM — 
`fixture.debugElement.query(By.css("..."))` + `.triggerEventHandler("click", 
...)` — instead of calling the handler methods directly.
   - Feed a `DashboardEntry` of each supported type (workflow / project / 
dataset / …) plus the flag combinations the template switches on (owned vs 
shared, liked vs not, editing vs display) so every `*ngIf` arm renders.
   
   Determinism constraint: `onEditName` / `onEditDescription` queue a 
`setTimeout` that focuses the input (component L338 / L351). **Do not add 
`vi.useFakeTimers()` just to suppress it** — 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. Assert `editingName` / 
the rendered input, not the focus.
   
   Do not assert on layout/geometry under jsdom; assert on rendered text, 
element presence, and the state the binding writes.
   
   ### 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