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
Task Summary
Add
panel.service.spec.tscoveringPanelService, a tiny event bus that exposes twoSubject<void>streams (closePanelStream,resetPanelStream) withclosePanels()/resetPanels()triggers.Background
frontend/src/app/workspace/service/panel/panel.service.tsis a dependency-free service (instantiable directly vianew PanelService()), so noTestBedwiring is required.Behavior to pin
resetPanelStream, callresetPanels()closePanelStream, callclosePanels()resetPanels()does not emit onclosePanelStream, and vice-versaSubscribe to the stream, invoke the trigger, and assert the emission count (e.g. increment a counter in the subscription). Follow
size-formatter.util.spec.tsfor the plaindescribe/it/expectstyle (ng test).Scope
frontend/src/app/workspace/service/panel/panel.service.spec.ts.Task Type