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.
[MD] UX refactor for datasource create page (opensearch-project#2501) (…
…opensearch-project#2559) * UX refactor for datasource create page Signed-off-by: Yibo Wang <yibow@amazon.com> * address comments&add CHANGLOG Signed-off-by: Yibo Wang <yibow@amazon.com> * Apply callout in all ds pages & update endpoint field placeholder text Signed-off-by: Yibo Wang <yibow@amazon.com> * add documentation links Signed-off-by: Yibo Wang <yibow@amazon.com> * update snapshot test and snapshots Signed-off-by: Yibo Wang <yibow@amazon.com> * Update CHANGELOG.md&.lycheeexclude Signed-off-by: Yibo Wang <yibow@amazon.com> * Update UT Signed-off-by: Yibo Wang <yibow@amazon.com> Signed-off-by: Yibo Wang <yibow@amazon.com> (cherry picked from commit 9b56ff5) Co-authored-by: Yibo Wang <109543558+yibow98@users.noreply.github.com>
- Loading branch information
1 parent
7888266
commit 37a6314
Showing
3 changed files
with
206 additions
and
1 deletion.
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
133 changes: 133 additions & 0 deletions
133
...ment_app/compoenent/experimental_callout/__snapshots__/experimental_callout.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
...ement/public/management_app/compoenent/experimental_callout/experimental_callout.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,29 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import { ExperimentalCallout } from './experimental_callout'; | ||
import { DocLinksStart } from 'opensearch-dashboards/public'; | ||
import { docLinks } from '../../../mocks'; | ||
|
||
const titleIdentifier = '.euiCallOutHeader__title'; | ||
const descriptionIdentifier = '[data-test-subj="data-source-experimental-call"]'; | ||
const expectedTitleText = 'Experimental Feature'; | ||
const expectedDescriptionText = | ||
'Experimental FeatureThe feature is experimental and should not be used in a production environment. Any index patterns, visualization, and observability panels will be impacted if the feature is deactivated. For more information see Data Source Documentation(opens in a new tab or window) To leave feedback, visit OpenSearch Forum'; | ||
|
||
describe('Datasource experimental callout component', () => { | ||
test('should render normally', () => { | ||
const mockedDocLinks = docLinks as DocLinksStart; | ||
const component = mount(<ExperimentalCallout docLinks={mockedDocLinks} />); | ||
const titleText = component.find(titleIdentifier).text(); | ||
const descriptionText = component.find(descriptionIdentifier).last().text(); | ||
|
||
expect(titleText).toBe(expectedTitleText); | ||
expect(descriptionText).toBe(expectedDescriptionText); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
}); |