diff --git a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/editor_frame.test.tsx b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/editor_frame.test.tsx index 5f8b5e383e2d1..716ea75e39824 100644 --- a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/editor_frame.test.tsx +++ b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/editor_frame.test.tsx @@ -17,6 +17,7 @@ import { DatasourceMock, } from '../mocks'; import { ExpressionRenderer } from 'src/legacy/core_plugins/data/public'; +import { EuiPanel, EuiToolTip } from '@elastic/eui'; // calling this function will wait for all pending Promises from mock // datasources to be processed by its callers. @@ -1119,13 +1120,12 @@ describe('editor_frame', () => { // TODO why is this necessary? instance.update(); - const suggestions = instance.find('[data-test-subj="suggestion-title"]'); - expect(suggestions.map(el => el.text())).toEqual([ - 'Suggestion1', - 'Suggestion2', - 'Suggestion3', - 'Suggestion4', - ]); + expect( + instance + .find('[data-test-subj="lnsSuggestion"]') + .find(EuiPanel) + .map(el => el.parents(EuiToolTip).prop('content')) + ).toEqual(['Suggestion1', 'Suggestion2', 'Suggestion3', 'Suggestion4']); }); it('should switch to suggested visualization', async () => { diff --git a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/suggestion_panel.test.tsx b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/suggestion_panel.test.tsx index a52684ca996ec..d2f3b8e895aa6 100644 --- a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/suggestion_panel.test.tsx +++ b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/editor_frame/suggestion_panel.test.tsx @@ -17,7 +17,7 @@ import { ExpressionRenderer } from 'src/legacy/core_plugins/data/public'; import { SuggestionPanel, SuggestionPanelProps } from './suggestion_panel'; import { getSuggestions, Suggestion } from './suggestion_helpers'; import { fromExpression } from '@kbn/interpreter/target/common'; -import { EuiIcon } from '@elastic/eui'; +import { EuiIcon, EuiPanel, EuiToolTip } from '@elastic/eui'; jest.mock('./suggestion_helpers'); @@ -82,10 +82,12 @@ describe('suggestion_panel', () => { it('should list passed in suggestions', () => { const wrapper = mount(); - expect(wrapper.find('[data-test-subj="suggestion-title"]').map(el => el.text())).toEqual([ - 'Suggestion1', - 'Suggestion2', - ]); + expect( + wrapper + .find('[data-test-subj="lnsSuggestion"]') + .find(EuiPanel) + .map(el => el.parents(EuiToolTip).prop('content')) + ).toEqual(['Suggestion1', 'Suggestion2']); }); it('should dispatch visualization switch action if suggestion is clicked', () => {