Skip to content

Commit

Permalink
feat: add unit test
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Apr 17, 2024
1 parent 56a795f commit 21de853
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/core/public/chrome/nav_links/to_nav_link.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ describe('toNavLink', () => {
})
);

// When app is accessible inside workspace or outside workspace.
expect(
toNavLink(
app({
Expand All @@ -212,5 +213,21 @@ describe('toNavLink', () => {
baseUrl: 'http://localhost/base_path/client_base_path/app/some-id',
})
);

expect(
toNavLink(
app({
workspaceAvailability:
// eslint-disable-next-line no-bitwise
WorkspaceAvailability.insideWorkspace | WorkspaceAvailability.outsideWorkspace,
}),
httpMock.basePath
).properties
).toEqual(
expect.objectContaining({
url: 'http://localhost/base_path/client_base_path/app/some-id',
baseUrl: 'http://localhost/base_path/client_base_path/app/some-id',
})
);
});
});

0 comments on commit 21de853

Please sign in to comment.