diff --git a/src/plugins/data/public/incomplete_results_modal/__snapshots__/incomplete_results_modal.test.tsx.snap b/src/plugins/data/public/incomplete_results_modal/__snapshots__/incomplete_results_modal.test.tsx.snap
new file mode 100644
index 00000000000000..666b87f998c3ed
--- /dev/null
+++ b/src/plugins/data/public/incomplete_results_modal/__snapshots__/incomplete_results_modal.test.tsx.snap
@@ -0,0 +1,271 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`IncompleteResultsModal should render shard failures 1`] = `
+
+
+
+
+
+
+
+
+
+ ,
+ "data-test-subj": "showClusterDetailsButton",
+ "id": "table",
+ "name": "Cluster details",
+ }
+ }
+ tabs={
+ Array [
+ Object {
+ "content":
+
+ ,
+ "data-test-subj": "showClusterDetailsButton",
+ "id": "table",
+ "name": "Cluster details",
+ },
+ Object {
+ "content":
+ {}
+ ,
+ "data-test-subj": "showRequestButton",
+ "id": "json-request",
+ "name": "Request",
+ },
+ Object {
+ "content":
+ {
+ "_shards": {
+ "total": 4,
+ "successful": 3,
+ "skipped": 0,
+ "failed": 1,
+ "failures": [
+ {
+ "shard": 0,
+ "index": "sample-01-rollup",
+ "node": "VFTFJxpHSdaoiGxJFLSExQ",
+ "reason": {
+ "type": "illegal_argument_exception",
+ "reason": "Field [kubernetes.container.memory.available.bytes] of type [aggregate_metric_double] is not supported for aggregation [percentiles]"
+ }
+ }
+ ]
+ }
+}
+ ,
+ "data-test-subj": "showResponseButton",
+ "id": "json-response",
+ "name": "Response",
+ },
+ ]
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`IncompleteResultsModal should render time out 1`] = `
+
+
+
+
+
+
+
+
+
+
+ Request timed out
+
+
+ ,
+ "data-test-subj": "showClusterDetailsButton",
+ "id": "table",
+ "name": "Cluster details",
+ }
+ }
+ tabs={
+ Array [
+ Object {
+ "content":
+
+
+ Request timed out
+
+
+ ,
+ "data-test-subj": "showClusterDetailsButton",
+ "id": "table",
+ "name": "Cluster details",
+ },
+ Object {
+ "content":
+ {}
+ ,
+ "data-test-subj": "showRequestButton",
+ "id": "json-request",
+ "name": "Request",
+ },
+ Object {
+ "content":
+ {
+ "timed_out": true,
+ "_shards": {
+ "total": 4,
+ "successful": 4,
+ "skipped": 0,
+ "failed": 0
+ }
+}
+ ,
+ "data-test-subj": "showResponseButton",
+ "id": "json-response",
+ "name": "Response",
+ },
+ ]
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+`;
diff --git a/src/plugins/data/public/incomplete_results_modal/incomplete_results_modal.test.tsx b/src/plugins/data/public/incomplete_results_modal/incomplete_results_modal.test.tsx
new file mode 100644
index 00000000000000..9ca4ab3e21fa14
--- /dev/null
+++ b/src/plugins/data/public/incomplete_results_modal/incomplete_results_modal.test.tsx
@@ -0,0 +1,68 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import React from 'react';
+import { shallow } from 'enzyme';
+import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
+import type { SearchResponseIncompleteWarning } from '../search';
+import { IncompleteResultsModal } from './incomplete_results_modal';
+
+describe('IncompleteResultsModal', () => {
+ test('should render shard failures', () => {
+ const component = shallow(
+ }
+ onClose={jest.fn()}
+ />
+ );
+
+ expect(component).toMatchSnapshot();
+ });
+
+ test('should render time out', () => {
+ const component = shallow(
+ }
+ onClose={jest.fn()}
+ />
+ );
+
+ expect(component).toMatchSnapshot();
+ });
+});
\ No newline at end of file
diff --git a/src/plugins/data/public/incomplete_results_modal/incomplete_results_modal.tsx b/src/plugins/data/public/incomplete_results_modal/incomplete_results_modal.tsx
index b5941903595bac..eb07d8d60e517f 100644
--- a/src/plugins/data/public/incomplete_results_modal/incomplete_results_modal.tsx
+++ b/src/plugins/data/public/incomplete_results_modal/incomplete_results_modal.tsx
@@ -62,7 +62,7 @@ export function IncompleteResultsModal({ request, response, warning, onClose }:
) : null}
- {response._shards.failures.length ? (
+ {response._shards.failures?.length ? (
) : null}
>