mengw15 opened a new issue, #7963:
URL: https://github.com/apache/texera/issues/7963
### Task Summary
Two dashboard templates each hold a block of markup that no test renders —
**19 uncovered lines** between them. In every case the component class is
already well covered; what is missing is that the spec calls the handlers
directly instead of driving the DOM, so the `[(ngModel)]` bindings, the
`(click)` handlers and one static guidance panel never execute.
Goal: render each block and bring both templates toward full coverage. Pure
EXTEND of the existing specs. Vitest/jsdom; see `frontend/TESTING.md` and
`frontend/AGENTS.md`.
Shared mechanics: `fixture.detectChanges()` after every state change; query
with `fixture.debugElement.query(By.css(...))` and fire events with
`.triggerEventHandler(...)`; seed the collections each `*ngFor` iterates so the
rows render. Use the local coverage report to catch anything left.
### Behavior to add
**Search filters**
(`frontend/src/app/dashboard/component/user/filters/filters.component.html`,
codecov 83.07 %, 11 uncovered lines — EXTEND `filters.component.spec.ts`)
Every filter list is rendered from a collection that the spec leaves empty,
so no row is ever produced:
- the date pickers `[(ngModel)]="selectedMtime"` (44) and
`[(ngModel)]="selectedCtime"` (69) — set each and assert the binding
round-trips;
- the four checkbox lists — owners (100–101), workflow IDs (134–135),
operators (171–172) and projects (207–209). Seed each collection with at least
two entries, toggle one checkbox, and assert the matching
`updateSelectedOwners()` / `updateSelectedIDs()` / `updateSelectedOperators()`
/ `updateSelectedProjects()` ran and the selection changed. Line 209 also
renders `{{project.name}}`, so assert the label text for the project rows.
**Dashboard list item controls**
(`frontend/src/app/dashboard/component/user/list-item/list-item.component.html`,
codecov 90.62 %, 8 uncovered lines — EXTEND `list-item.component.spec.ts`)
- the inline rename input (99–105) — `[(ngModel)]="entry.name"` with
`confirmUpdateCustomName(entry.name)` bound to both `(blur)` and
`(keydown.enter)`. Enter rename mode, change the value, and fire each of the
two events, asserting the confirm handler ran with the new name.
- the action buttons — `openDetailModal(this.entry.id)` (192),
`onClickOpenShareAccess()` (201), `onClickDownload()` (221), and the delete
confirmation `(nzOnConfirm)="deleted.emit()"` (231). Fire each from the
rendered control and assert the handler ran or the `deleted` output emitted.
- the download button's guard `*ngIf="entry.type === 'workflow' ||
entry.type === 'dataset'"` (219) — render with each of those types and with a
third type so both sides of the `||` and the absent case are covered.
Determinism notes:
- **Clone the entry fixture per test** for the list item — the rename
handler mutates `entry.name` in place, so a shared object leaks a renamed value
into a later test.
- Stub the services each component injects and emit with `of(...)`; never a
real backend.
- Do not assert on `DatePipe`-rendered text (a fixed epoch renders a
different day under a UTC runner) — rendering a date is fine, asserting the
string is not.
- No layout or geometry assertions — `getBoundingClientRect` /
`scrollHeight` return zeros under jsdom.
- `fixture.destroy()` in `afterEach` so `@UntilDestroy` subscriptions stop,
and `vi.restoreAllMocks()` 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]