From 28cfa8c7a99c2b9016e25f903cb7b6a1c21a083d Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Tue, 23 Apr 2024 07:56:28 +0800 Subject: [PATCH] Update src/plugins/workspace/public/utils.test.ts Co-authored-by: Miki Signed-off-by: SuZhou-Joe --- src/plugins/workspace/public/utils.test.ts | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/plugins/workspace/public/utils.test.ts b/src/plugins/workspace/public/utils.test.ts index 6c7bfb836462..39858ac36aa3 100644 --- a/src/plugins/workspace/public/utils.test.ts +++ b/src/plugins/workspace/public/utils.test.ts @@ -163,4 +163,33 @@ describe('workspace utils: isAppAccessibleInWorkspace', () => { ) ).toBe(false); }); + + it('An app is accessible within a workspace if its workspaceAvailability is insideWorkspace', () => { + expect( + isAppAccessibleInWorkspace( + { + id: 'home', + title: 'Any app', + mount: jest.fn(), + workspaceAvailability: WorkspaceAvailability.insideWorkspace, + }, + { id: 'workspace_id', name: 'workspace name', features: [] } + ) + ).toBe(true); + }); + + it('An app is accessible within a workspace if its workspaceAvailability is inside and outsideWorkspace', () => { + expect( + isAppAccessibleInWorkspace( + { + id: 'home', + title: 'Any app', + mount: jest.fn(), + // eslint-disable-next-line no-bitwise + workspaceAvailability: WorkspaceAvailability.insideWorkspace | WorkspaceAvailability.outsideWorkspace, + }, + { id: 'workspace_id', name: 'workspace name', features: [] } + ) + ).toBe(true); + }); });