From 21de853e43bf362016e316fd54bf2a299551267c Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Thu, 18 Apr 2024 01:06:20 +0800 Subject: [PATCH] feat: add unit test Signed-off-by: SuZhou-Joe --- .../public/chrome/nav_links/to_nav_link.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/core/public/chrome/nav_links/to_nav_link.test.ts b/src/core/public/chrome/nav_links/to_nav_link.test.ts index bfac3a5754cd..8d88c15c85ae 100644 --- a/src/core/public/chrome/nav_links/to_nav_link.test.ts +++ b/src/core/public/chrome/nav_links/to_nav_link.test.ts @@ -199,6 +199,7 @@ describe('toNavLink', () => { }) ); + // When app is accessible inside workspace or outside workspace. expect( toNavLink( app({ @@ -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', + }) + ); }); });