-
Notifications
You must be signed in to change notification settings - Fork 914
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
185 additions
and
5 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
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