-
Notifications
You must be signed in to change notification settings - Fork 917
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[navigation]fix: redirect user to home in global when workspace is en…
…abled (#7551) * feat: redirect user to home when in global Signed-off-by: SuZhou-Joe <[email protected]> * Changeset file for PR #7551 created/updated * Changeset file for PR #7551 created/updated * feat: add some comment Signed-off-by: SuZhou-Joe <[email protected]> * feat: remove useless change Signed-off-by: SuZhou-Joe <[email protected]> * feat: optimize comment Signed-off-by: SuZhou-Joe <[email protected]> * feat: optimize description and variable naming Signed-off-by: SuZhou-Joe <[email protected]> * feat: update Signed-off-by: SuZhou-Joe <[email protected]> --------- Signed-off-by: SuZhou-Joe <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Anan Zhuang <[email protected]>
- Loading branch information
1 parent
2b7dbe0
commit 96936f3
Showing
6 changed files
with
113 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fix: | ||
- [navigation]feat: redirect user to home in global when workspace is enabled ([#7551](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7551)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { fireEvent, render } from '@testing-library/react'; | ||
import { DevToolsIcon } from './dev_tools_icon'; | ||
import { coreMock } from '../../../core/public/mocks'; | ||
import { DEFAULT_NAV_GROUPS } from '../../../core/public'; | ||
|
||
describe('<DevToolsIcon />', () => { | ||
it('should call chrome.navGroup.setCurrentNavGroup and application.navigateToApp methods from core service when click', () => { | ||
const coreStartMock = coreMock.createStart(); | ||
const { container } = render(<DevToolsIcon core={coreStartMock} appId="foo" />); | ||
const component = container.children[0]; | ||
fireEvent.click(component); | ||
expect(coreStartMock.chrome.navGroup.setCurrentNavGroup).toBeCalledWith( | ||
DEFAULT_NAV_GROUPS.dataAdministration.id | ||
); | ||
expect(coreStartMock.application.navigateToApp).toBeCalledWith('foo'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters