forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
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 (opensearch-project#7551) * feat: redirect user to home when in global Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * Changeset file for PR opensearch-project#7551 created/updated * Changeset file for PR opensearch-project#7551 created/updated * feat: add some comment Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: remove useless change Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: optimize comment Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: optimize description and variable naming Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: update Signed-off-by: SuZhou-Joe <suzhou@amazon.com> --------- Signed-off-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com>
- Loading branch information
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