From c7f61f956a581bf39be01f9e0c263577c2165b6b Mon Sep 17 00:00:00 2001 From: Shahzad Date: Mon, 13 Apr 2020 13:49:46 +0200 Subject: [PATCH] [Uptime] Update Ml functional test (#62562) * update test * added test * updated type * updated test * updated test * update test Co-authored-by: Elastic Machine --- .../connected/empty_state/empty_state.tsx | 6 +- .../confirm_delete.test.tsx.snap | 2 + .../__snapshots__/license_info.test.tsx.snap | 2 + .../__snapshots__/ml_flyout.test.tsx.snap | 5 ++ .../ml_integerations.test.tsx.snap | 1 + .../__snapshots__/ml_manage_job.test.tsx.snap | 1 + .../monitor_details/ml/confirm_delete.tsx | 1 + .../monitor_details/ml/license_info.tsx | 1 + .../monitor_details/ml/manage_ml_job.tsx | 8 ++- .../monitor_details/ml/ml_flyout.tsx | 3 +- .../ml/ml_flyout_container.tsx | 6 +- .../monitor_details/ml/ml_integeration.tsx | 2 +- .../plugins/uptime/public/pages/settings.tsx | 2 +- x-pack/test/functional/apps/uptime/index.ts | 5 +- .../test/functional/apps/uptime/ml_anomaly.ts | 51 ++++++++++++++++ x-pack/test/functional/apps/uptime/monitor.ts | 7 +-- .../test/functional/apps/uptime/overview.ts | 24 ++++---- .../functional/page_objects/uptime_page.ts | 39 ++++++------ .../test/functional/services/uptime/common.ts | 15 +++++ .../functional/services/uptime/ml_anomaly.ts | 59 +++++++++++++++++++ .../functional/services/uptime/navigation.ts | 52 +++++++++++----- .../test/functional/services/uptime/uptime.ts | 3 + 22 files changed, 235 insertions(+), 60 deletions(-) create mode 100644 x-pack/test/functional/apps/uptime/ml_anomaly.ts create mode 100644 x-pack/test/functional/services/uptime/ml_anomaly.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/connected/empty_state/empty_state.tsx b/x-pack/legacy/plugins/uptime/public/components/connected/empty_state/empty_state.tsx index b383a696095a32..55c92e70b6066d 100644 --- a/x-pack/legacy/plugins/uptime/public/components/connected/empty_state/empty_state.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/connected/empty_state/empty_state.tsx @@ -4,20 +4,22 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useEffect } from 'react'; +import React, { useContext, useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { indexStatusAction } from '../../../state/actions'; import { indexStatusSelector } from '../../../state/selectors'; import { EmptyStateComponent } from '../../functional/empty_state/empty_state'; +import { UptimeRefreshContext } from '../../../contexts'; export const EmptyState: React.FC = ({ children }) => { const { data, loading, error } = useSelector(indexStatusSelector); + const { lastRefresh } = useContext(UptimeRefreshContext); const dispatch = useDispatch(); useEffect(() => { dispatch(indexStatusAction.get()); - }, [dispatch]); + }, [dispatch, lastRefresh]); return (
diff --git a/x-pack/legacy/plugins/uptime/public/components/monitor_details/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap b/x-pack/legacy/plugins/uptime/public/components/monitor_details/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap index ead27425c26f3b..a83a1d99d7bb0c 100644 --- a/x-pack/legacy/plugins/uptime/public/components/monitor_details/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap +++ b/x-pack/legacy/plugins/uptime/public/components/monitor_details/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap @@ -3,6 +3,7 @@ exports[`ML Flyout component renders without errors 1`] = `