From 765700f3626b216c332fe22fe2845e7e0fdb264f Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 5 Dec 2019 14:59:21 -0600 Subject: [PATCH] Upgrade EUI to v16.1.0 (#52088) * eui 16.1.0 * snapshot udpates * more snapshot updates * enqueueStateChange mock, resulting snapshot updates --- package.json | 2 +- src/dev/jest/setup/mocks.js | 9 +++++++++ .../plugins/kbn_tp_run_pipeline/package.json | 2 +- .../plugins/kbn_tp_custom_visualizations/package.json | 2 +- .../plugins/kbn_tp_embeddable_explorer/package.json | 2 +- .../plugins/kbn_tp_sample_panel_action/package.json | 2 +- .../__snapshots__/autoplay_settings.examples.storyshot | 3 +++ .../__snapshots__/toolbar_settings.examples.storyshot | 3 +++ .../__tests__/__snapshots__/settings.test.tsx.snap | 4 +++- .../note_card/__snapshots__/note_card_body.test.tsx.snap | 2 +- .../paginated_table/__snapshots__/index.test.tsx.snap | 2 +- x-pack/package.json | 2 +- yarn.lock | 8 ++++---- 13 files changed, 30 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index b5e77bb1c2a8e..10d745aa10563 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "@elastic/charts": "^14.0.0", "@elastic/datemath": "5.0.2", "@elastic/ems-client": "1.0.5", - "@elastic/eui": "16.0.0", + "@elastic/eui": "16.1.0", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", "@elastic/numeral": "2.3.3", diff --git a/src/dev/jest/setup/mocks.js b/src/dev/jest/setup/mocks.js index f17c0f44536b6..19c88d3cc35e4 100644 --- a/src/dev/jest/setup/mocks.js +++ b/src/dev/jest/setup/mocks.js @@ -47,3 +47,12 @@ jest.mock('moment-timezone', () => { moment.tz.guess = () => 'America/New_York'; return moment; }); + +jest.mock('@elastic/eui/lib/services/react', () => { + // `enqueueStateChange` is an EUI method to batch queued functions that trigger React `setState` calls. + // This is for performance, but when used in certain Jest scernarios it can be nondeterministic. + // Jest tests are never concerned about the state prior to batch completion, so we bypass batching entirely. + return { + enqueueStateChange: fn => fn(), + }; +}); diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json index 51b9a5c5f1786..69f958fb91f60 100644 --- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json +++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json @@ -7,7 +7,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "16.0.0", + "@elastic/eui": "16.1.0", "react": "^16.12.0", "react-dom": "^16.12.0" } diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json index fd0ce478eb6fb..96a5e26a74109 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json @@ -7,7 +7,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "16.0.0", + "@elastic/eui": "16.1.0", "react": "^16.12.0" } } diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json index 98df7f4b246dc..e95aa04ddd6b1 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json @@ -8,7 +8,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "16.0.0", + "@elastic/eui": "16.1.0", "react": "^16.12.0" }, "scripts": { diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json index 32f441ba6ccda..f874cecd5d812 100644 --- a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json +++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json @@ -8,7 +8,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "16.0.0", + "@elastic/eui": "16.1.0", "react": "^16.12.0" }, "scripts": { diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/autoplay_settings.examples.storyshot b/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/autoplay_settings.examples.storyshot index e9f496bfe6358..27d82a664ff2a 100644 --- a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/autoplay_settings.examples.storyshot +++ b/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/autoplay_settings.examples.storyshot @@ -30,6 +30,7 @@ exports[`Storyshots shareables/Footer/Settings/AutoplaySettings component: off, aria-labelledby="generated-id" className="euiSwitch__button" id="cycle" + name="cycle" onClick={[Function]} role="switch" type="button" @@ -198,6 +199,7 @@ exports[`Storyshots shareables/Footer/Settings/AutoplaySettings component: on, 5 aria-labelledby="generated-id" className="euiSwitch__button" id="cycle" + name="cycle" onClick={[Function]} role="switch" type="button" @@ -366,6 +368,7 @@ exports[`Storyshots shareables/Footer/Settings/AutoplaySettings contextual 1`] = aria-labelledby="generated-id" className="euiSwitch__button" id="cycle" + name="cycle" onClick={[Function]} role="switch" type="button" diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/toolbar_settings.examples.storyshot b/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/toolbar_settings.examples.storyshot index 2fa6b83aef4f0..a550c7ec47c92 100644 --- a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/toolbar_settings.examples.storyshot +++ b/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/toolbar_settings.examples.storyshot @@ -38,6 +38,7 @@ exports[`Storyshots shareables/Footer/Settings/ToolbarSettings component: off 1` className="euiSwitch__button" data-test-subj="hideToolbarSwitch" id="generated-id" + name="toolbarHide" onBlur={[Function]} onClick={[Function]} onFocus={[Function]} @@ -132,6 +133,7 @@ exports[`Storyshots shareables/Footer/Settings/ToolbarSettings component: on 1`] className="euiSwitch__button" data-test-subj="hideToolbarSwitch" id="generated-id" + name="toolbarHide" onBlur={[Function]} onClick={[Function]} onFocus={[Function]} @@ -226,6 +228,7 @@ exports[`Storyshots shareables/Footer/Settings/ToolbarSettings contextual 1`] = className="euiSwitch__button" data-test-subj="hideToolbarSwitch" id="generated-id" + name="toolbarHide" onBlur={[Function]} onClick={[Function]} onFocus={[Function]} diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/__snapshots__/settings.test.tsx.snap b/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/__snapshots__/settings.test.tsx.snap index fbd8c9c5ab0c3..9d7590e977011 100644 --- a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/__snapshots__/settings.test.tsx.snap +++ b/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/__snapshots__/settings.test.tsx.snap @@ -316,6 +316,7 @@ exports[` can navigate Autoplay Settings 2`] = ` aria-labelledby="generated-id" class="euiSwitch__button" id="cycle" + name="cycle" role="switch" type="button" > @@ -784,6 +785,7 @@ exports[` can navigate Toolbar Settings, closes when activated 2`] = class="euiSwitch__button" data-test-subj="hideToolbarSwitch" id="generated-id" + name="toolbarHide" role="switch" type="button" > @@ -856,4 +858,4 @@ exports[` can navigate Toolbar Settings, closes when activated 2`] = `; -exports[` can navigate Toolbar Settings, closes when activated 3`] = `"
Settings

Hide Toolbar

Hide the toolbar when the mouse is not within the Canvas?
"`; +exports[` can navigate Toolbar Settings, closes when activated 3`] = `"
Settings

Hide Toolbar

Hide the toolbar when the mouse is not within the Canvas?
"`; diff --git a/x-pack/legacy/plugins/siem/public/components/notes/note_card/__snapshots__/note_card_body.test.tsx.snap b/x-pack/legacy/plugins/siem/public/components/notes/note_card/__snapshots__/note_card_body.test.tsx.snap index c9a40975e7b92..526bb52c61afa 100644 --- a/x-pack/legacy/plugins/siem/public/components/notes/note_card/__snapshots__/note_card_body.test.tsx.snap +++ b/x-pack/legacy/plugins/siem/public/components/notes/note_card/__snapshots__/note_card_body.test.tsx.snap @@ -249,7 +249,7 @@ exports[`NoteCardBody renders correctly against snapshot 1`] = ` "euiFormControlPadding": "12px", "euiFormCustomControlBorderColor": "#66676d", "euiFormCustomControlDisabledIconColor": "#a6aab0", - "euiFormInputGroupBorder": "1px solid #313338", + "euiFormInputGroupBorder": "1px solid #282a30", "euiFormInputGroupLabelBackground": "#1f2127", "euiFormMaxWidth": "400px", "euiGradientMiddle": "#282a31", diff --git a/x-pack/legacy/plugins/siem/public/components/paginated_table/__snapshots__/index.test.tsx.snap b/x-pack/legacy/plugins/siem/public/components/paginated_table/__snapshots__/index.test.tsx.snap index 4ac25720080a9..ddeb701c3ee31 100644 --- a/x-pack/legacy/plugins/siem/public/components/paginated_table/__snapshots__/index.test.tsx.snap +++ b/x-pack/legacy/plugins/siem/public/components/paginated_table/__snapshots__/index.test.tsx.snap @@ -249,7 +249,7 @@ exports[`Paginated Table Component rendering it renders the default load more ta "euiFormControlPadding": "12px", "euiFormCustomControlBorderColor": "#66676d", "euiFormCustomControlDisabledIconColor": "#a6aab0", - "euiFormInputGroupBorder": "1px solid #313338", + "euiFormInputGroupBorder": "1px solid #282a30", "euiFormInputGroupLabelBackground": "#1f2127", "euiFormMaxWidth": "400px", "euiGradientMiddle": "#282a31", diff --git a/x-pack/package.json b/x-pack/package.json index 68f1309bcbb39..e51d10fbf5749 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -175,7 +175,7 @@ "@babel/runtime": "^7.5.5", "@elastic/datemath": "5.0.2", "@elastic/ems-client": "1.0.5", - "@elastic/eui": "16.0.0", + "@elastic/eui": "16.1.0", "@elastic/filesaver": "1.1.2", "@elastic/maki": "6.1.0", "@elastic/node-crypto": "^1.0.0", diff --git a/yarn.lock b/yarn.lock index d61ae67ff064d..184acddd0d1d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1226,10 +1226,10 @@ tabbable "^1.1.0" uuid "^3.1.0" -"@elastic/eui@16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-16.0.0.tgz#511898bfbeba5ffea6ac96c077d1184d657a451d" - integrity sha512-i9t13PzrsfBUolMZ6n2X9aAYJ/wUI2NJduCQlDU4zrXfFrM1LFJ5/KSCcpgzI8VNDakeA3PTml+oqD7J0qGA3g== +"@elastic/eui@16.1.0": + version "16.1.0" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-16.1.0.tgz#b8311a4dd3146da2fcd8cec6ae1ed46e26f90746" + integrity sha512-WbfIc2RGojrUeYyEIjiQ0Cy4xbk6YJ6eQ+ymFHSDGqwkKy5IidSBZIDNLM13LzAhxBFTAMmfVsk4lB2qiFlolQ== dependencies: "@types/lodash" "^4.14.116" "@types/numeral" "^0.0.25"