diff --git a/src/core_plugins/input_control_vis/public/components/editor/controls_tab.test.js b/src/core_plugins/input_control_vis/public/components/editor/controls_tab.test.js index f46e4cd5a559e..0cc5dc7120c91 100644 --- a/src/core_plugins/input_control_vis/public/components/editor/controls_tab.test.js +++ b/src/core_plugins/input_control_vis/public/components/editor/controls_tab.test.js @@ -1,7 +1,7 @@ import React from 'react'; import sinon from 'sinon'; import { mount, shallow } from 'enzyme'; -import { findTestSubject } from 'ui_framework/test'; +import { findTestSubject } from '@elastic/eui/lib/test'; import { ControlsTab, } from './controls_tab'; diff --git a/src/core_plugins/input_control_vis/public/components/vis/input_control_vis.test.js b/src/core_plugins/input_control_vis/public/components/vis/input_control_vis.test.js index 674d526ea7b0b..5eb22ba5a98f5 100644 --- a/src/core_plugins/input_control_vis/public/components/vis/input_control_vis.test.js +++ b/src/core_plugins/input_control_vis/public/components/vis/input_control_vis.test.js @@ -1,7 +1,7 @@ import React from 'react'; import sinon from 'sinon'; import { mount, shallow } from 'enzyme'; -import { findTestSubject } from 'ui_framework/test'; +import { findTestSubject } from '@elastic/eui/lib/test'; import { InputControlVis, diff --git a/src/core_plugins/kibana/public/dashboard/panel/dashboard_panel.test.js b/src/core_plugins/kibana/public/dashboard/panel/dashboard_panel.test.js index 322936be9a722..bf572512c8f4a 100644 --- a/src/core_plugins/kibana/public/dashboard/panel/dashboard_panel.test.js +++ b/src/core_plugins/kibana/public/dashboard/panel/dashboard_panel.test.js @@ -14,7 +14,7 @@ import { getEmbeddableFactoryMock } from '../__tests__/get_embeddable_factories_ import { takeMountedSnapshot, -} from 'ui_framework/test'; +} from '@elastic/eui/lib/test'; function getProps(props = {}) { const defaultTestProps = { diff --git a/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_header_container.test.js b/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_header_container.test.js index 4b91d80dd9caa..81ce301dda225 100644 --- a/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_header_container.test.js +++ b/src/core_plugins/kibana/public/dashboard/panel/panel_header/panel_header_container.test.js @@ -14,9 +14,7 @@ import { embeddableRenderFinished, } from '../../actions'; import { getEmbeddableFactoryMock } from '../../__tests__/get_embeddable_factories_mock'; -import { - TestSubjects, -} from 'ui_framework/test'; +import { findTestSubject } from '@elastic/eui/lib/test'; function getProps(props = {}) { const defaultTestProps = { @@ -40,20 +38,20 @@ afterAll(() => { test('Panel header shows embeddable title when nothing is set on the panel', () => { component = mount(); - expect(TestSubjects.getText(component, 'dashboardPanelTitle')).toBe('my embeddable title'); + expect(findTestSubject(component, 'dashboardPanelTitle').text()).toBe('my embeddable title'); }); test('Panel header shows panel title when it is set on the panel', () => { store.dispatch(setPanelTitle('my custom panel title', 'foo1')); - expect(TestSubjects.getText(component, 'dashboardPanelTitle')).toBe('my custom panel title'); + expect(findTestSubject(component, 'dashboardPanelTitle').text()).toBe('my custom panel title'); }); test('Panel header shows no panel title when it is set to an empty string on the panel', () => { store.dispatch(setPanelTitle('', 'foo1')); - expect(TestSubjects.getText(component, 'dashboardPanelTitle')).toBe(''); + expect(findTestSubject(component, 'dashboardPanelTitle').text()).toBe(''); }); test('Panel header shows embeddable title when the panel title is reset', () => { store.dispatch(resetPanelTitle('foo1')); - expect(TestSubjects.getText(component, 'dashboardPanelTitle')).toBe('my embeddable title'); + expect(findTestSubject(component, 'dashboardPanelTitle').text()).toBe('my embeddable title'); }); diff --git a/src/core_plugins/kibana/public/dashboard/top_nav/clone_modal.test.js b/src/core_plugins/kibana/public/dashboard/top_nav/clone_modal.test.js index 3638aa6eab185..59310258cf623 100644 --- a/src/core_plugins/kibana/public/dashboard/top_nav/clone_modal.test.js +++ b/src/core_plugins/kibana/public/dashboard/top_nav/clone_modal.test.js @@ -3,7 +3,7 @@ import sinon from 'sinon'; import { mount, render } from 'enzyme'; import { findTestSubject, -} from 'ui_framework/test'; +} from '@elastic/eui/lib/test'; import { DashboardCloneModal, diff --git a/ui_framework/src/test/index.js b/ui_framework/src/test/index.js index 94e5bd41564b2..02a0977d7b087 100644 --- a/ui_framework/src/test/index.js +++ b/ui_framework/src/test/index.js @@ -1,6 +1,3 @@ export { requiredProps } from './required_props'; export { takeMountedSnapshot } from './take_mounted_snapshot'; export { findTestSubject } from './find_test_subject'; -import * as TestSubjects from './test_subjects'; -export { TestSubjects }; - diff --git a/ui_framework/src/test/test_subjects.js b/ui_framework/src/test/test_subjects.js deleted file mode 100644 index 5f674663f1021..0000000000000 --- a/ui_framework/src/test/test_subjects.js +++ /dev/null @@ -1,8 +0,0 @@ - -export function find(element, dataTestSubject) { - return element.find(`[data-test-subj="${dataTestSubject}"]`); -} - -export function getText(element, dataTestSubject) { - return find(element, dataTestSubject).text(); -} diff --git a/ui_framework/test/index.js b/ui_framework/test/index.js deleted file mode 100644 index 6821eadd764fe..0000000000000 --- a/ui_framework/test/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '../src/test';