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

   ### Task Summary
   
   Two component **templates** have large uncovered blocks (~45 lines total) 
that their specs never render. **Goal: bring both templates to full coverage** 
— render every branch, drive every binding through the DOM, and use the 
coverage report to catch anything left. Vitest/jsdom; see `frontend/TESTING.md`.
   
   General approach: `fixture.detectChanges()` after **every** state change (it 
is the template-coverage switch); drive bindings via 
`fixture.debugElement.query(By.css("..."))` + `.triggerEventHandler(...)` 
rather than calling handlers directly; put the component in **each** state the 
template switches on. Assert rendered text / bound attributes / delegated calls 
— never layout or geometry (zeros under jsdom).
   
   ### Behavior to add
   
   **UserDatasetVersionFiletreeComponent** 
(`frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-filetree/user-dataset-version-filetree.component.html`,
 **~23%**, 17 lines)
   - The file-tree node markup is unrendered. Supply a small tree (a folder 
with children plus a leaf file) so the node template renders both arms of 
`*ngIf="node.data.children"` — the folder icon and the file icon.
   - Assert the node label binding `title="{{ node.data.name }}"` and the icon 
chosen for each node kind.
   - Click/expand a node through the DOM and assert the selection or expansion 
state the component exposes.
   - Determinism: the component queues a `setTimeout`. **Do not add 
`vi.useFakeTimers()` 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.
   
   **AdminUserComponent** 
(`frontend/src/app/dashboard/component/admin/user/admin-user.component.html`, 
~81%, 28 lines)
   - The uncovered block is the per-column **search dropdowns**: 
`[(nzVisible)]="nameSearchVisible"` / `emailSearchVisible` / 
`commentSearchVisible` and their `[(ngModel)]="nameSearchValue"` inputs.
   - For each column: open the dropdown (set its visible flag / click the 
trigger), `detectChanges()`, type a value into the bound input (set the control 
value and dispatch `input`), apply the search, and assert the filtered rows 
rendered in the table; then reset and assert the filter clears.
   - Determinism: the component uses `new Date` and the template renders a 
date. **Render it, but do not assert any formatted date/time string** — a fixed 
epoch renders differently under a UTC CI runner; assert element presence or a 
timezone-stable substring. Likewise do not add fake timers for the component's 
`setTimeout`.
   
   ### 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