mengw15 opened a new issue, #7466:
URL: https://github.com/apache/texera/issues/7466
### Task Summary
`DatasetFileSelectorComponent`'s **template** is at **12.5%**
(`dataset-file-selector.component.html`, 7 uncovered lines of 31) while its
class file is ~92%. The selector's input and its "Select File" button are never
rendered, so their bindings stay unexecuted. Bring the template to full
coverage. Vitest/jsdom; see `frontend/TESTING.md`.
### Behavior to add
Extend `dataset-file-selector.component.spec.ts` so each template branch
renders, then run the coverage report and cover the remaining red lines. The
gap is the `*ngIf` arms around the value display (`formControl.value ||
!isFileSelectionEnabled`), the `[readOnly]` binding, and the
`(click)="isFileSelectionEnabled && onClickOpenFileSelectionModal()"` button.
Approach:
- `fixture.detectChanges()` after each state change.
- Render the states the template switches on: file-selection enabled vs
disabled (the button appears only when enabled; the input is read-only only
when enabled), and with vs without a value on the `formControl`.
- Click the "Select File" button through the DOM —
`fixture.debugElement.query(By.css("button"))` + `.triggerEventHandler("click",
...)` — and assert the modal-opening collaborator (`vi.fn()` double) was
called; also assert the guarded case (disabled) does **not** call it.
Assert on rendered text / element presence / the state a binding writes —
not on layout or geometry.
### 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]