From 35795e25e9e1cb46ec9b50d11c4b9edd3140ff38 Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Tue, 4 Feb 2020 09:17:22 -0700 Subject: [PATCH] Fixing tests by mocking out useKibanaUISetting --- .../pages/metrics/components/time_controls.test.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/x-pack/legacy/plugins/infra/public/pages/metrics/components/time_controls.test.tsx b/x-pack/legacy/plugins/infra/public/pages/metrics/components/time_controls.test.tsx index 624a2bb4a6f0f7..91e25fd8ef5854 100644 --- a/x-pack/legacy/plugins/infra/public/pages/metrics/components/time_controls.test.tsx +++ b/x-pack/legacy/plugins/infra/public/pages/metrics/components/time_controls.test.tsx @@ -3,6 +3,18 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +jest.mock('../../../utils/use_kibana_ui_setting', () => ({ + _esModule: true, + useKibanaUiSetting: jest.fn(() => [ + [ + { + from: 'now/d', + to: 'now/d', + display: 'Today', + }, + ], + ]), +})); import React from 'react'; import { MetricsTimeControls } from './time_controls';