Skip to content

Commit

Permalink
fix: unit test
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
  • Loading branch information
SuZhou-Joe committed Apr 12, 2024
1 parent 764d168 commit ef97b45
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('<WorkspaceMenu />', () => {
render(<WorkspaceMenu coreStart={coreStartMock} />);
fireEvent.click(screen.getByText(/select a workspace/i));
fireEvent.click(screen.getByText(/create workspace/i));
expect(window.location.assign).toHaveBeenCalledWith('https://test.com/app/workspace_create');
expect(coreStartMock.application.navigateToApp).toHaveBeenCalledWith('workspace_create');

Object.defineProperty(window, 'location', {
value: originalLocation,
Expand All @@ -111,7 +111,7 @@ describe('<WorkspaceMenu />', () => {
render(<WorkspaceMenu coreStart={coreStartMock} />);
fireEvent.click(screen.getByText(/select a workspace/i));
fireEvent.click(screen.getByText(/all workspace/i));
expect(window.location.assign).toHaveBeenCalledWith('https://test.com/app/workspace_list');
expect(coreStartMock.application.navigateToApp).toHaveBeenCalledWith('workspace_list');

Object.defineProperty(window, 'location', {
value: originalLocation,
Expand Down

0 comments on commit ef97b45

Please sign in to comment.