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 /
@Inputs 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
Task Summary
ConsoleFrameComponent's template is at ~26% (console-frame.component.html, 68 uncovered lines) while its class fileconsole-frame.component.tsis 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; seefrontend/TESTING.md.Behavior to add
Extend
console-frame.component.spec.tsso the template actually renders each of its branches, then run the coverage report and cover the remaining red lines. The uncovered constructs are*ngIfbranches,*ngForlists,(click)handlers and[(ngModel)]bindings — for example theshowTimestamp/showSourcedisplay toggles and the message list.Approach (standard Angular/Vitest):
fixture.detectChanges()after every state change — it is the template-coverage switch.fixture.debugElement.query(By.css("..."))then.triggerEventHandler("click", ...)/ set the control value and dispatchinput.@Inputs so each*ngIfarm renders (empty vs populated console, error vs normal message, each toggle on and off) and*ngForexpands over a few messages.Determinism constraints for this component (please follow — CI runs a multi-OS matrix):
| 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.ngAfterViewCheckedqueues asetTimeoutthat setsscrollTop = scrollHeightfor auto-scroll (component L167). Do not reach forvi.useFakeTimers()just to stop it — a synchronous test body never lets the callback run, and layering fake timers over zone.js's patchedsetInterval/setTimeoutis Node-version dependent and has produced CI-only failures. Leave real timers alone.scrollHeight,getBoundingClientRect) — they return zeros under jsdom. Assert on rendered text, element presence, and the component state the binding updates.Task Type