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.
[Multiple Datasource Test] Add test for error_menu, item, data_source…
…_multi_selectable (opensearch-project#6752) * add test for data_source_error_menu, data_source_item, data_source_multi_selectable Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * Changeset file for PR opensearch-project#6752 created/updated * add content verify in test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> --------- Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
- Loading branch information
1 parent
bead9ae
commit e8715b3
Showing
5 changed files
with
185 additions
and
4 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: | ||
- Add test for data_source_error_menu, data_source_item, data_source_multi_selectable ([#6752](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6752)) |
95 changes: 95 additions & 0 deletions
95
...blic/components/data_source_error_menu/__snapshots__/data_source_error_menu.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...ource_management/public/components/data_source_error_menu/data_source_error_menu.test.tsx
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,28 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { DataSourceErrorMenu } from './data_source_error_menu'; | ||
import { coreMock } from '../../../../../core/public/mocks'; | ||
import { render } from '@testing-library/react'; | ||
|
||
describe('DataSourceErrorMenu', () => { | ||
const applicationMock = coreMock.createStart().application; | ||
it('renders without crashing', () => { | ||
const component = shallow(<DataSourceErrorMenu application={applicationMock} />); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
it('should toggle popover when icon button is clicked', () => { | ||
const container = render(<DataSourceErrorMenu application={applicationMock} />); | ||
const iconButton = container.getByTestId('dataSourceErrorMenuHeaderLink'); | ||
iconButton.click(); | ||
expect(container.getByTestId('dataSourceErrorPopover')).toBeVisible(); | ||
expect(container.getByTestId('datasourceTableEmptyState')).toHaveTextContent( | ||
'Failed to fetch data sources' | ||
); | ||
}); | ||
}); |
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