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

   ### Task Summary
   
   `workflow-execution-history.component.html` has **25 uncovered template 
lines at 78.86 %**, while its component class sits at 93.43 %. The spec is 
mature — 46 `it()` blocks — but calls `detectChanges()` only four times, so it 
exercises the handlers directly and almost never renders the markup that 
invokes them. Its spec does **not** call `TestBed.overrideComponent`, so 
template coverage attributes normally and the gap is genuinely reachable.
   
   Pure EXTEND. Vitest/jsdom; see `frontend/TESTING.md` and 
`frontend/AGENTS.md`.
   
   ### Behavior to add
   
   **Execution-history template** 
(`frontend/src/app/dashboard/component/user/user-workflow/ngbd-modal-workflow-executions/workflow-execution-history.component.html`,
 codecov 78.86 % — EXTEND `workflow-execution-history.component.spec.ts`)
   
   The mechanics throughout: `fixture.detectChanges()` after every state 
change, query with `fixture.debugElement.query(By.css(...))` and fire 
`.triggerEventHandler(...)` instead of calling the handler on the instance, and 
seed the rows/state each `*ngIf` and `*ngFor` needs so its arm renders.
   
   - **Search-criteria panel** (43–58) — one contiguous help block that only 
appears when the criteria popover is open: the criteria list (execution name, 
`user:John`, `status:…`), the double-quote note, and the worked example. Open 
the panel, render, and assert the list items and example text are present. 
Static markup — no async.
   - **Search input** (31) — the `[(ngModel)]="executionSearchValue"` binding, 
exercised by typing into the rendered input.
   - **Bulk actions** (80, 89, 116–117) — `setBookmarked()`, the `nzOnConfirm` 
on group delete (`onGroupDelete()`), and the header checkbox's 
`(nzCheckedChange)="onAllChecked($event)"` / `[(nzChecked)]="checked"`. Cover 
checking and unchecking all.
   - **Sortable headers** (128, 137) — `(click)="onHit(column, i)"` on both 
header cells; fire the click and assert the sort state changed rather than 
calling `onHit` directly.
   - **Per-row controls** (153, 158, 166, 185, 230, 244) — the row checkbox 
`(nzCheckedChange)="onItemChecked(row, $event)"`, the bookmark toggle 
`(click)="onBookmarkToggle(row)"`, the `[avatar]="row.avatar"` binding, 
entering rename mode via `workflowExecutionsIsEditingName.push(i)`, 
`showRuntimeStatistics(row.eId, row.cuId)`, and the delete confirmation 
`(nzOnConfirm)="onDelete(row)"`. Seed at least two rows so the `*ngFor` expands 
and the index-based rename push is meaningful.
   
   Determinism notes — **this component renders Plotly charts, and its tests 
were flaky once before (fixed in #6542)**:
   - **Do NOT `vi.mock("plotly.js-basic-dist-min")`.** Module-level Plotly 
mocking is unreliable across the CI matrix — if another spec loads the module 
first the mock does not apply, real `Plotly.newPlot` runs, and it throws `No 
DOM element with id '…'`. `vi.spyOn(Plotly, "newPlot")` also fails (ESM 
namespace not configurable).
   - Instead follow #6542: attach the fixture to `document.body` so the chart's 
target div resolves by id, let real Plotly render, and assert on the `data` / 
`layout` Plotly attaches to the graph div.
   - Do not assert on `DatePipe`-rendered timestamps — a fixed epoch renders a 
different day under a UTC runner. Rendering them is fine; asserting the text is 
not.
   - No layout or geometry assertions — `getBoundingClientRect` / 
`scrollHeight` return zeros under jsdom.
   - `fixture.destroy()` in `afterEach` so any `@UntilDestroy` subscription 
stops, and `vi.restoreAllMocks()` so spies do not leak. Clone row fixtures per 
test, since rename and bookmark handlers mutate rows in place.
   - Stub the HTTP layer with `HttpClientTestingModule` and flush synchronously.
   
   Note #7752 is open and touches this component's spec — rebase before 
finishing.
   
   ### 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