Skip to content

Commit

Permalink
[MD] Add experimental callout for index pattern section (opensearch-p…
Browse files Browse the repository at this point in the history
…roject#2523) (opensearch-project#2561)

* Add experimental callout for index pattern section

Signed-off-by: Yibo Wang <[email protected]>

* add switch for experimental callout & update snapshots

Signed-off-by: Yibo Wang <[email protected]>

* Update UT

Signed-off-by: Yibo Wang <[email protected]>

Signed-off-by: Yibo Wang <[email protected]>
(cherry picked from commit 7777749)

Co-authored-by: Yibo Wang <[email protected]>
  • Loading branch information
2 people authored and Peter Fitzgibbons committed Dec 1, 2022
1 parent 16f16aa commit 440b65b
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from 'react';
import { mount } from 'enzyme';
import { ExperimentalCallout } from './experimental_callout';

const titleIdentifier = '.euiCallOutHeader__title';
const descriptionIdentifier = '[data-test-subj="index-pattern-experimental-callout-text"]';
const expectedTitleText = 'Experimental feature active';
const expectedDescriptionText =
'The experimental feature Data Source Connection is active. To create an index pattern without using data from an external source, use default. Any index pattern created using an external data source will result in an error if the experimental feature is deactivated.';

describe('Index pattern experimental callout component', () => {
test('should render normally', () => {
const component = mount(<ExperimentalCallout />);
const titleText = component.find(titleIdentifier).text();
const descriptionText = component.find(descriptionIdentifier).last().text();

expect(titleText).toBe(expectedTitleText);
expect(descriptionText).toBe(expectedDescriptionText);
expect(component).toMatchSnapshot();
});
});

0 comments on commit 440b65b

Please sign in to comment.