Skip to content

Commit

Permalink
add test for WorkspacesService.stop() function
Browse files Browse the repository at this point in the history
Signed-off-by: Yulong Ruan <[email protected]>
  • Loading branch information
ruanyl committed Sep 21, 2023
1 parent 652f7df commit ca18f50
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/public/workspace/workspaces_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,13 @@ describe('WorkspacesService', () => {
workspacesStart.currentWorkspaceId$.next('workspace-3');
expect(workspacesStart.currentWorkspace$.hasError).toBe(true);
});

it('should stop all observables when workspace service stopped', () => {
workspaces.stop();
expect(workspacesStart.currentWorkspaceId$.isStopped).toBe(true);
expect(workspacesStart.currentWorkspace$.isStopped).toBe(true);
expect(workspacesStart.workspaceList$.isStopped).toBe(true);
expect(workspacesStart.workspaceEnabled$.isStopped).toBe(true);
expect(workspacesStart.initialized$.isStopped).toBe(true);
});
});

0 comments on commit ca18f50

Please sign in to comment.