Skip to content

add unit test coverage for UndoRedoService, WorkflowConsoleService, and NotificationService #6589

Description

@mengw15

Task Summary

Three workspace services whose specs are near-empty (each asserts little beyond creation) while codecov sits well below their real surface. Extend each spec. Vitest; see frontend/TESTING.md (reuse Stub…Service doubles / useValue + vi.fn()).

Behavior to add

UndoRedoService (frontend/src/app/workspace/service/undo-redo/undo-redo.service.ts, codecov ~67%)

  • Drive via setUndoManager(...) with a Y.UndoManager double (or a real one over a Y.Doc): undoAction / redoAction call undo / redo only when canUndo / canRedo; canUndo / canRedo / getUndoLength / getRedoLength reflect the manager; clearUndoStack / clearRedoStack clear it; enableWorkFlowModification / disableWorkFlowModification toggle the guard so actions become no-ops when disabled.

WorkflowConsoleService (frontend/src/app/workspace/service/workflow-console/workflow-console.service.ts, codecov ~68%)

  • getConsoleMessages / hasConsoleMessages after messages arrive; clearConsoleMessages empties the store and pushes an update on getConsoleMessageUpdateStream; registerAutoClearConsoleMessages clears on the configured trigger.

NotificationService (frontend/src/app/common/service/notification/notification.service.ts, codecov ~47%)

  • Inject NzMessageService + NzNotificationService doubles (vi.fn()). Assert success / error / info / warning / blank delegate to the right notification type with the given title/content/options, and loading / remove delegate to the message service.

Task Type

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions