mengw15 opened a new issue, #7329:
URL: https://github.com/apache/texera/issues/7329
### Task Summary
`ConsoleFrameComponent`'s **template** is at ~26%
(`console-frame.component.html`, 68 uncovered lines) while its class file
`console-frame.component.ts` is already ~94%. The existing spec drives the
component class directly but never renders most of the template, so the
bindings and conditional blocks stay unexecuted. Bring the template to full
coverage. Vitest/jsdom; see `frontend/TESTING.md`.
### Behavior to add
Extend `console-frame.component.spec.ts` so the template actually renders
each of its branches, then run the coverage report and cover the remaining red
lines. The uncovered constructs are `*ngIf` branches, `*ngFor` lists, `(click)`
handlers and `[(ngModel)]` bindings — for example the `showTimestamp` /
`showSource` display toggles and the message list.
Approach (standard Angular/Vitest):
- Call `fixture.detectChanges()` after every state change — it is the
template-coverage switch.
- Drive the bindings through the DOM rather than by calling methods
directly: `fixture.debugElement.query(By.css("..."))` then
`.triggerEventHandler("click", ...)` / set the control value and dispatch
`input`.
- Seed component state / `@Input`s so each `*ngIf` arm renders (empty vs
populated console, error vs normal message, each toggle on and off) and
`*ngFor` expands over a few messages.
Determinism constraints for this component (please follow — CI runs a
multi-OS matrix):
- The message row renders a timestamp through `| date : "M-d-yy,
HH:mm:ss.SSS"` (template L135). **Render it, but do not assert the formatted
string** — a fixed epoch renders a different day/hour under a UTC CI runner.
Assert the row exists / other cell text instead, or match a timezone-stable
substring.
- `ngAfterViewChecked` queues a `setTimeout` that sets `scrollTop =
scrollHeight` for auto-scroll (component L167). **Do not reach for
`vi.useFakeTimers()` just to stop it** — a synchronous test body never lets the
callback run, and layering fake timers over zone.js's patched
`setInterval`/`setTimeout` is Node-version dependent and has produced CI-only
failures. Leave real timers alone.
- Do not assert on layout or geometry (`scrollHeight`,
`getBoundingClientRect`) — they return zeros under jsdom. Assert on rendered
text, element presence, and the component state the binding updates.
### 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]