Skip to content

extend LeftPanelComponent template coverage #7363

Description

@mengw15

Task Summary

LeftPanelComponent's template is at ~45% (left-panel.component.html, 32 uncovered lines) while its class file is already at 100%. The panel's frame tabs are never rendered/clicked in the spec, so their bindings stay uncovered. Bring the template to full coverage. Vitest/jsdom; see frontend/TESTING.md.

Behavior to add

Extend left-panel.component.spec.ts so the tab list renders and each branch is exercised, then run the coverage report and cover the remaining red lines. The uncovered constructs are (click) handlers (openFrame(0), openFrame(i)), the *ngFor over the panel items, *ngIf branches and tooltips.

Approach:

  • Provide a panel-item config so the *ngFor expands over several frames, then fixture.detectChanges().
  • Click the rendered tabs via fixture.debugElement.queryAll(By.css("...")) + .triggerEventHandler("click", ...) and assert the active frame changes (rather than calling openFrame directly).
  • Toggle the flags the template switches on (collapsed/expanded, enabled/disabled frames) so each *ngIf arm renders.

Determinism constraint: ngAfterViewInit queues a setTimeout that measures tab heights via querySelectorAll on the rendered collapse panels (component L143). Do not add vi.useFakeTimers() to suppress or drive 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. Also do not assert the measured heights (getBoundingClientRect/offset sizes are zeros under jsdom) — assert the rendered tabs and the active-frame state instead.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions