From 58257c27348aceccea9006c910a657e11f80be2f Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Tue, 19 Jun 2018 17:43:26 +0200 Subject: [PATCH] Update EUI to 0.0.53 (#20005) * Update to EUI 0.0.53 * Remove input vis specific styling * remove double close button in dashboard add panel flyout (#2) * Fix functional tests * fix x-pack snapshots * EUI 0.0.53 no longer closes combo box when clear btn is pressed (#3) --- package.json | 2 +- .../public/components/editor/controls_tab.js | 1 - .../components/editor/controls_tab.less | 3 -- .../__snapshots__/add_panel.test.js.snap | 14 +----- .../public/dashboard/top_nav/add_panel.js | 9 ---- .../dashboard/top_nav/add_panel.test.js | 16 +------ .../__snapshots__/flyout.test.js.snap | 12 +++++- .../__snapshots__/relationships.test.js.snap | 30 ++++++++++--- .../apps/visualize/_input_control_vis.js | 2 +- test/functional/config.js | 2 + .../functional/page_objects/visualize_page.js | 5 ++- .../services/dashboard/add_panel.js | 5 ++- test/functional/services/flyout.js | 43 +++++++++++++++++++ test/functional/services/index.js | 1 + x-pack/package.json | 2 +- .../__snapshots__/detail_drawer.test.js.snap | 30 ++++++++++--- x-pack/yarn.lock | 6 +-- yarn.lock | 6 +-- 18 files changed, 123 insertions(+), 66 deletions(-) delete mode 100644 src/core_plugins/input_control_vis/public/components/editor/controls_tab.less create mode 100644 test/functional/services/flyout.js diff --git a/package.json b/package.json index e3ef30cc3aff6d..817e2b82ebe6aa 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "url": "https://github.com/elastic/kibana.git" }, "dependencies": { - "@elastic/eui": "v0.0.52", + "@elastic/eui": "0.0.53", "@elastic/filesaver": "1.1.2", "@elastic/numeral": "2.3.2", "@elastic/ui-ace": "0.2.3", diff --git a/src/core_plugins/input_control_vis/public/components/editor/controls_tab.js b/src/core_plugins/input_control_vis/public/components/editor/controls_tab.js index f17d6cff1eda53..ed5bd5436b4ae4 100644 --- a/src/core_plugins/input_control_vis/public/components/editor/controls_tab.js +++ b/src/core_plugins/input_control_vis/public/components/editor/controls_tab.js @@ -17,7 +17,6 @@ * under the License. */ -import './controls_tab.less'; import _ from 'lodash'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; diff --git a/src/core_plugins/input_control_vis/public/components/editor/controls_tab.less b/src/core_plugins/input_control_vis/public/components/editor/controls_tab.less deleted file mode 100644 index c7a2c4118c047e..00000000000000 --- a/src/core_plugins/input_control_vis/public/components/editor/controls_tab.less +++ /dev/null @@ -1,3 +0,0 @@ -.euiAccordion__childWrapper { - overflow: visible; -} diff --git a/src/core_plugins/kibana/public/dashboard/top_nav/__snapshots__/add_panel.test.js.snap b/src/core_plugins/kibana/public/dashboard/top_nav/__snapshots__/add_panel.test.js.snap index b968f50a3a5ae9..52709245b93aac 100644 --- a/src/core_plugins/kibana/public/dashboard/top_nav/__snapshots__/add_panel.test.js.snap +++ b/src/core_plugins/kibana/public/dashboard/top_nav/__snapshots__/add_panel.test.js.snap @@ -4,6 +4,7 @@ exports[`render 1`] = ` - - - Add Panels - - - diff --git a/src/core_plugins/kibana/public/dashboard/top_nav/add_panel.test.js b/src/core_plugins/kibana/public/dashboard/top_nav/add_panel.test.js index fa414a15555f43..6af26997acc8be 100644 --- a/src/core_plugins/kibana/public/dashboard/top_nav/add_panel.test.js +++ b/src/core_plugins/kibana/public/dashboard/top_nav/add_panel.test.js @@ -19,10 +19,7 @@ import React from 'react'; import sinon from 'sinon'; -import { mount, shallow } from 'enzyme'; -import { - findTestSubject, -} from '@elastic/eui/lib/test'; +import { shallow } from 'enzyme'; import { DashboardAddPanel, @@ -49,14 +46,3 @@ test('render', () => { />); expect(component).toMatchSnapshot(); }); - -test('onClose', () => { - const component = mount( {}} - addNewPanel={() => {}} - addNewVis={() => {}} - />); - findTestSubject(component, 'closeAddPanelBtn', false).simulate('click'); - sinon.assert.calledOnce(onClose); -}); diff --git a/src/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/__tests__/__snapshots__/flyout.test.js.snap b/src/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/__tests__/__snapshots__/flyout.test.js.snap index d476d6422a3a1a..d4f67b3c260f85 100644 --- a/src/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/__tests__/__snapshots__/flyout.test.js.snap +++ b/src/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/__tests__/__snapshots__/flyout.test.js.snap @@ -2,10 +2,14 @@ exports[`Flyout conflicts should allow conflict resolution 1`] = ` - + @@ -157,10 +161,14 @@ exports[`Flyout conflicts should handle errors 1`] = ` exports[`Flyout should render import step 1`] = ` - + diff --git a/src/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/__tests__/__snapshots__/relationships.test.js.snap b/src/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/__tests__/__snapshots__/relationships.test.js.snap index 1f358b9355eee8..266803ef7e3983 100644 --- a/src/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/__tests__/__snapshots__/relationships.test.js.snap +++ b/src/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/__tests__/__snapshots__/relationships.test.js.snap @@ -2,10 +2,14 @@ exports[`Relationships should render dashboards normally 1`] = ` - + @@ -127,10 +131,14 @@ exports[`Relationships should render dashboards normally 1`] = ` exports[`Relationships should render errors 1`] = ` - + @@ -190,10 +198,14 @@ exports[`Relationships should render errors 1`] = ` exports[`Relationships should render index patterns normally 1`] = ` - + @@ -371,10 +383,14 @@ exports[`Relationships should render index patterns normally 1`] = ` exports[`Relationships should render searches normally 1`] = ` - + @@ -550,10 +566,14 @@ exports[`Relationships should render searches normally 1`] = ` exports[`Relationships should render visualizations normally 1`] = ` - + diff --git a/test/functional/apps/visualize/_input_control_vis.js b/test/functional/apps/visualize/_input_control_vis.js index 57797f72333fc1..b0fb79a9c25daa 100644 --- a/test/functional/apps/visualize/_input_control_vis.js +++ b/test/functional/apps/visualize/_input_control_vis.js @@ -183,7 +183,7 @@ export default function ({ getService, getPageObjects }) { }); }); - describe('nested controls', () => { + describe('chained controls', () => { before(async () => { await PageObjects.common.navigateToUrl('visualize', 'new'); diff --git a/test/functional/config.js b/test/functional/config.js index 4625f422699156..d0236a0b7a0029 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -48,6 +48,7 @@ import { VisualizeListingTableProvider, DashboardAddPanelProvider, DashboardPanelActionsProvider, + FlyoutProvider, } from './services'; export default async function ({ readConfigFile }) { @@ -101,6 +102,7 @@ export default async function ({ readConfigFile }) { visualizeListingTable: VisualizeListingTableProvider, dashboardAddPanel: DashboardAddPanelProvider, dashboardPanelActions: DashboardPanelActionsProvider, + flyout: FlyoutProvider, }, servers: commonConfig.get('servers'), diff --git a/test/functional/page_objects/visualize_page.js b/test/functional/page_objects/visualize_page.js index 84fcf6cc256373..48fe7d03320886 100644 --- a/test/functional/page_objects/visualize_page.js +++ b/test/functional/page_objects/visualize_page.js @@ -261,14 +261,15 @@ export function VisualizePageProvider({ getService, getPageObjects }) { async clearComboBox(comboBoxSelector) { const comboBox = await testSubjects.find(comboBoxSelector); - const clearBtn = await comboBox.findByCssSelector('button.euiFormControlLayoutClearButton'); + const clearBtn = await comboBox.findByCssSelector('[data-test-subj="comboBoxClearButton"]'); await clearBtn.click(); + await this.closeComboBoxOptionsList(comboBox); } async closeComboBoxOptionsList(comboBoxElement) { const isOptionsListOpen = await testSubjects.exists('comboBoxOptionsList'); if (isOptionsListOpen) { - const closeBtn = await comboBoxElement.findByCssSelector('button.euiFormControlLayoutCustomIcon'); + const closeBtn = await comboBoxElement.findByCssSelector('[data-test-subj="comboBoxToggleListButton"]'); await closeBtn.click(); } } diff --git a/test/functional/services/dashboard/add_panel.js b/test/functional/services/dashboard/add_panel.js index 1277e5fad2a1e5..64df0bf612e17f 100644 --- a/test/functional/services/dashboard/add_panel.js +++ b/test/functional/services/dashboard/add_panel.js @@ -22,6 +22,7 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) { const log = getService('log'); const retry = getService('retry'); const testSubjects = getService('testSubjects'); + const flyout = getService('flyout'); const PageObjects = getPageObjects(['header', 'common']); return new class DashboardAddPanel { @@ -93,11 +94,11 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) { } async closeAddPanel() { - log.debug('closeAddPanel'); + log.debug('DashboardAddPanel.closeAddPanel'); const isOpen = await this.isAddPanelOpen(); if (isOpen) { await retry.try(async () => { - await testSubjects.click('closeAddPanelBtn'); + await flyout.close('dashboardAddPanel'); const isOpen = await this.isAddPanelOpen(); if (isOpen) { throw new Error('Add panel still open, trying again.'); diff --git a/test/functional/services/flyout.js b/test/functional/services/flyout.js new file mode 100644 index 00000000000000..bbf33735a8fe86 --- /dev/null +++ b/test/functional/services/flyout.js @@ -0,0 +1,43 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export function FlyoutProvider({ getService }) { + const testSubjects = getService('testSubjects'); + const find = getService('find'); + + class Flyout { + + async getFlyout(testSubj) { + if (testSubj) { + return await testSubjects.find(testSubj); + } else { + return await find.byCssSelector('.euiFlyout'); + } + } + + async close(panelTestSubj) { + const panelElement = await this.getFlyout(panelTestSubj); + const closeBtn = await panelElement.findByCssSelector('[aria-label*="Close"]'); + await closeBtn.click(); + } + + } + + return new Flyout(); +} diff --git a/test/functional/services/index.js b/test/functional/services/index.js index c637a46e467229..f60a276f093a02 100644 --- a/test/functional/services/index.js +++ b/test/functional/services/index.js @@ -26,5 +26,6 @@ export { DocTableProvider } from './doc_table'; export { ScreenshotsProvider } from './screenshots'; export { FailureDebuggingProvider } from './failure_debugging'; export { VisualizeListingTableProvider } from './visualize_listing_table'; +export { FlyoutProvider } from './flyout'; export * from './dashboard'; diff --git a/x-pack/package.json b/x-pack/package.json index 81b6697207caf7..8380123c26c43e 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -76,7 +76,7 @@ "yargs": "4.7.1" }, "dependencies": { - "@elastic/eui": "0.0.52", + "@elastic/eui": "0.0.53", "@elastic/node-crypto": "0.1.2", "@elastic/node-phantom-simple": "2.2.4", "@elastic/numeral": "2.3.2", diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/detail_drawer.test.js.snap b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/detail_drawer.test.js.snap index 337b7738fd924f..88984a824f7ecf 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/detail_drawer.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/detail_drawer.test.js.snap @@ -2,10 +2,14 @@ exports[`DetailDrawer component If vertices shows basic info and no stats for if 1`] = ` - + - + - + - + - +