mengw15 opened a new issue, #7496:
URL: https://github.com/apache/texera/issues/7496
### Task Summary
Four component **templates** still have uncovered markup while their class
files are already 84–97% covered — together ~35 uncovered template lines. In
each case the spec drives the component class but never renders the branch, so
the bindings never execute. **Goal: bring all four templates to full coverage**
— render every branch, drive every binding through the DOM, and use the local
coverage report to catch anything left. Vitest/jsdom; see `frontend/TESTING.md`.
General approach for all four:
- `fixture.detectChanges()` after **every** state change — it is the
template-coverage switch.
- Drive bindings through the DOM
(`fixture.debugElement.query(By.css("..."))` + `.triggerEventHandler("click",
...)`) instead of calling handlers directly, so the `(click)` attribute itself
executes.
- Put the component in **each** state the template switches on so every
`*ngIf` arm renders and every `*ngFor` expands.
- Assert rendered text / bound attributes / delegated service calls —
**never** layout or geometry (zeros under jsdom).
### Behavior to add
**MarkdownDescriptionComponent**
(`frontend/src/app/workspace/component/markdown-description/markdown-description.component.html`,
~74%, 13 lines)
- `(click)="enterEditMode()"` — click the trigger, assert edit mode is
entered.
- The rendered `[innerHTML]="renderedDescription"` block — assert the
sanitized markdown output for a sample description.
- `(click)="toggleViewMore()"` plus the chevron's `[nzType]="isExpanded ?
'up' : 'down'"` — click and assert the bound type flips both ways.
- Render both a short and a long description so the "view more" control
appears/disappears.
**PresetWrapperComponent**
(`frontend/src/app/workspace/component/preset-wrapper/preset-wrapper.component.html`,
~62%, 7 lines)
- Seed a couple of presets so the row `*ngFor` renders; assert each row's
`{{ getEntryTitle(preset) }}` / `{{ getEntryDescription(preset) }}` text.
- `(click)="applyPreset(preset)"` — click a row, assert the service double
was called with that preset.
- `(click)="$event.stopPropagation(); deletePreset(preset)"` — click delete
passing an event whose `stopPropagation` is a spy; assert both that the spy
fired and that `deletePreset` was called.
- Cover the empty-list arm.
**PropertyEditorComponent**
(`frontend/src/app/workspace/component/property-editor/property-editor.component.html`,
~84%, 7 lines)
- `(click)="closePanel()"` and `(click)="openPanel()"` (the collapsed-state
`<li>`) — click each and assert the panel state toggles, rendering both the
open and collapsed arms.
- 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.
**AdminExecutionComponent**
(`frontend/src/app/dashboard/component/admin/execution/admin-execution.component.html`,
~89%, 8 lines)
- Seed executions so the table renders; assert the interpolations `{{
maxStringLength(execution.workflowName, 16) }}` and `{{
convertSecondsToTime(execution.executionTime) }}` produce the values those
helpers return.
- Cover the "Not Available" arm (an execution missing the value that branch
guards).
- `(click)="killExecution(execution.workflowId)"` — click and assert the
service double received the workflow id.
- Determinism: the component uses `new Date`. **Do not assert any rendered
date/time string** (a fixed epoch renders differently under a UTC CI runner) —
assert element presence, the `convertSecondsToTime` output (a pure duration
string), or a timezone-stable substring.
### 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]