diff --git a/package.json b/package.json
index 1ff42384f95d51..c3d19367e8b924 100644
--- a/package.json
+++ b/package.json
@@ -112,7 +112,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 f17c0f44536b6f..19c88d3cc35e42 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 51b9a5c5f17860..69f958fb91f603 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 fd0ce478eb6fb2..96a5e26a741093 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 98df7f4b246dc6..e95aa04ddd6b1f 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 32f441ba6ccda8..f874cecd5d812c 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 e9f496bfe6358f..27d82a664ff2ab 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 2fa6b83aef4f0f..a550c7ec47c922 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 fbd8c9c5ab0c30..9d7590e977011f 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[`
Hide Toolbar
Hide Toolbar