Skip to content

Commit d6ae907

Browse files
SuZhou-JoeAMoo-Miki
andcommitted
Update src/plugins/workspace/public/utils.test.ts
Co-authored-by: Miki <[email protected]> Signed-off-by: SuZhou-Joe <[email protected]>
1 parent 8eb9fc2 commit d6ae907

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/plugins/workspace/public/utils.test.ts

+29
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,35 @@ describe('workspace utils: isAppAccessibleInWorkspace', () => {
167167
)
168168
).toBe(false);
169169
});
170+
171+
it('An app is accessible within a workspace if its workspaceAvailability is insideWorkspace', () => {
172+
expect(
173+
isAppAccessibleInWorkspace(
174+
{
175+
id: 'home',
176+
title: 'Any app',
177+
mount: jest.fn(),
178+
workspaceAvailability: WorkspaceAvailability.insideWorkspace,
179+
},
180+
{ id: 'workspace_id', name: 'workspace name', features: [] }
181+
)
182+
).toBe(true);
183+
});
184+
185+
it('An app is accessible within a workspace if its workspaceAvailability is inside and outsideWorkspace', () => {
186+
expect(
187+
isAppAccessibleInWorkspace(
188+
{
189+
id: 'home',
190+
title: 'Any app',
191+
mount: jest.fn(),
192+
// eslint-disable-next-line no-bitwise
193+
workspaceAvailability: WorkspaceAvailability.insideWorkspace | WorkspaceAvailability.outsideWorkspace,
194+
},
195+
{ id: 'workspace_id', name: 'workspace name', features: [] }
196+
)
197+
).toBe(true);
198+
});
170199
});
171200

172201
describe('workspace utils: filterWorkspaceConfigurableApps', () => {

0 commit comments

Comments
 (0)