Skip to content

Commit

Permalink
Update src/plugins/workspace/public/utils.test.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Miki <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe and AMoo-Miki authored Apr 22, 2024
1 parent 84760ea commit 28cfa8c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/plugins/workspace/public/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

0 comments on commit 28cfa8c

Please sign in to comment.