From deacd8de1f3923a59f57139075c548f6ed64d51b Mon Sep 17 00:00:00 2001 From: Lukas Olson Date: Wed, 11 Dec 2024 07:59:27 -0700 Subject: [PATCH] Fix tests --- examples/search_examples/public/search/app.tsx | 14 +++++++++----- .../search_examples/search_sessions_cache.ts | 8 ++++++-- .../feature_controls/management_security.ts | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/examples/search_examples/public/search/app.tsx b/examples/search_examples/public/search/app.tsx index 6639d446e80ec..a5807075a3992 100644 --- a/examples/search_examples/public/search/app.tsx +++ b/examples/search_examples/public/search/app.tsx @@ -91,6 +91,7 @@ export const SearchExamplesApp = ({ const [timeTook, setTimeTook] = useState(); const [total, setTotal] = useState(100); const [loaded, setLoaded] = useState(0); + const [executedAt, setExecutedAt] = useState(0); const [dataView, setDataView] = useState(); const [fields, setFields] = useState(); const [selectedFields, setSelectedFields] = useState([]); @@ -113,6 +114,7 @@ export const SearchExamplesApp = ({ setLoaded(response.loaded!); setTotal(response.total!); setTimeTook(response.rawResponse.took); + setExecutedAt((response as IMyStrategyResponse).executed_at); } // Fetch the default data view using the `data.dataViews` service, as the component is mounted. @@ -215,7 +217,6 @@ export const SearchExamplesApp = ({ res.rawResponse.aggregations[1].value : undefined; const isCool = (res as IMyStrategyResponse).cool; - const executedAt = (res as IMyStrategyResponse).executed_at; const message = ( Searched {res.rawResponse.hits.total as number} documents.
@@ -223,10 +224,6 @@ export const SearchExamplesApp = ({ {aggResult ? Math.floor(aggResult) : 0}.
{isCool ? `Is it Cool? ${isCool}` : undefined} -
- - {executedAt ? `Executed at? ${executedAt}` : undefined} -
); notifications.toasts.addSuccess( @@ -471,6 +468,13 @@ export const SearchExamplesApp = ({ values={{ time: timeTook ?? 'Unknown' }} /> + + + { + return (await toasts.getCount()) > 0; + }); + await testSubjects.click('responseTab'); + const timeElem = await testSubjects.find('requestExecutedAt'); const text = await timeElem.getVisibleText(); + await testSubjects.click('requestTab'); await toasts.dismissAll(); await retry.waitFor('toasts gone', async () => { return (await toasts.getCount()) === 0; diff --git a/x-pack/test/functional/apps/management/feature_controls/management_security.ts b/x-pack/test/functional/apps/management/feature_controls/management_security.ts index 286963b77d53b..9f73f5500cb4d 100644 --- a/x-pack/test/functional/apps/management/feature_controls/management_security.ts +++ b/x-pack/test/functional/apps/management/feature_controls/management_security.ts @@ -82,8 +82,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { sectionLinks: [ 'dataViews', 'filesManagement', - 'aiAssistantManagementSelection', 'objects', + 'aiAssistantManagementSelection', 'tags', 'search_sessions', 'spaces',