From b0895539b1977d9571e7e4fe2f485112af752c53 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Tue, 21 Sep 2021 12:04:41 -0600 Subject: [PATCH] [Maps] fix unhandled promise rejections in jest tests --- .../edit_layer_panel.test.tsx.snap | 4 +- .../edit_layer_panel.test.tsx | 3 ++ .../__snapshots__/toc_entry.test.tsx.snap | 50 +++++++++++++++++-- .../layer_toc/toc_entry/toc_entry.test.tsx | 3 ++ 4 files changed, 54 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/__snapshots__/edit_layer_panel.test.tsx.snap b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/__snapshots__/edit_layer_panel.test.tsx.snap index 24f15674a0504..a2ad6fa62dce6 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/__snapshots__/edit_layer_panel.test.tsx.snap +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/__snapshots__/edit_layer_panel.test.tsx.snap @@ -101,9 +101,10 @@ exports[`EditLayerPanel is rendered 1`] = ` "renderSourceSettingsEditor": [Function], "showJoinEditor": [Function], "supportsElasticsearchFilters": [Function], + "supportsFitToBounds": [Function], } } - supportsFitToBounds={false} + supportsFitToBounds={true} />
mockSourceSettings @@ -120,6 +121,7 @@ exports[`EditLayerPanel is rendered 1`] = ` "renderSourceSettingsEditor": [Function], "showJoinEditor": [Function], "supportsElasticsearchFilters": [Function], + "supportsFitToBounds": [Function], } } layerDisplayName="layer 1" diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/edit_layer_panel.test.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/edit_layer_panel.test.tsx index 5b6f9c2ffc834..73e831724e78e 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/edit_layer_panel.test.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/edit_layer_panel.test.tsx @@ -76,6 +76,9 @@ const mockLayer = { hasErrors: () => { return false; }, + supportsFitToBounds: () => { + return true; + }, } as unknown as ILayer; const defaultProps = { diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/__snapshots__/toc_entry.test.tsx.snap b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/__snapshots__/toc_entry.test.tsx.snap index 42618d099ffcf..5beaf12029d2f 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/__snapshots__/toc_entry.test.tsx.snap +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/__snapshots__/toc_entry.test.tsx.snap @@ -24,10 +24,11 @@ exports[`TOCEntry is rendered 1`] = ` "isVisible": [Function], "renderLegendDetails": [Function], "showAtZoomLevel": [Function], + "supportsFitToBounds": [Function], } } openLayerSettings={[Function]} - supportsFitToBounds={false} + supportsFitToBounds={true} />
+
+
+
+
+ { return true; }, + supportsFitToBounds: () => { + return true; + }, } as unknown as ILayer; const defaultProps = {