Skip to content

add unit test coverage for PanelService #6262

Description

@aglinxinyuan

Task Summary

Add panel.service.spec.ts covering PanelService, a tiny event bus that exposes two Subject<void> streams (closePanelStream, resetPanelStream) with closePanels() / resetPanels() triggers.

Background

frontend/src/app/workspace/service/panel/panel.service.ts is a dependency-free service (instantiable directly via new PanelService()), so no TestBed wiring is required.

get resetPanelStream() { return this.resetPanelSubject.asObservable(); }
resetPanels() { this.resetPanelSubject.next(); }
get closePanelStream() { return this.closePanelSubject.asObservable(); }
closePanels() { this.closePanelSubject.next(); }

Behavior to pin

Scenario Contract
subscribe resetPanelStream, call resetPanels() subscriber fires exactly once
subscribe closePanelStream, call closePanels() subscriber fires exactly once
stream independence calling resetPanels() does not emit on closePanelStream, and vice-versa

Subscribe to the stream, invoke the trigger, and assert the emission count (e.g. increment a counter in the subscription). Follow size-formatter.util.spec.ts for the plain describe/it/expect style (ng test).

Scope

  • New spec: frontend/src/app/workspace/service/panel/panel.service.spec.ts.
  • No production-code changes.

Task Type

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions