diff --git a/x-pack/plugins/synthetics/e2e/journeys/synthetics/overview_sorting.journey.ts b/x-pack/plugins/synthetics/e2e/journeys/synthetics/overview_sorting.journey.ts index cb8417450c96d..45c63fb389ab2 100644 --- a/x-pack/plugins/synthetics/e2e/journeys/synthetics/overview_sorting.journey.ts +++ b/x-pack/plugins/synthetics/e2e/journeys/synthetics/overview_sorting.journey.ts @@ -35,6 +35,16 @@ journey('OverviewSorting', async ({ page, params }) => { await syntheticsApp.navigateToOverview(true, 15); }); + step('sort should reload monitor cards', async () => { + await page.waitForSelector(`[data-test-subj="syntheticsOverviewGridItem"]`); + await page.click('[data-test-subj="syntheticsOverviewSortButton"]'); + await page.click('button:has-text("Alphabetical")'); + await page.waitForSelector(`[data-test-subj="syntheticsOverviewMonitorsLoading"]`); + await page.waitForSelector(`text=${testMonitor1}`); + await page.waitForSelector(`text=${testMonitor2}`); + await page.waitForSelector(`text=${testMonitor3}`); + }); + step('sort alphabetical asc', async () => { await page.waitForSelector(`[data-test-subj="syntheticsOverviewGridItem"]`); await page.click('[data-test-subj="syntheticsOverviewSortButton"]'); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_pagination_info.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_pagination_info.tsx index 150855abb21cd..461227567d85b 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_pagination_info.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_pagination_info.tsx @@ -70,7 +70,7 @@ export const OverviewPaginationInfo = ({ )} ) : ( - + diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx index 2e4eb6ca03a31..106e9f1ec4373 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx @@ -72,11 +72,11 @@ export const OverviewPage: React.FC = () => { // fetch overview for all other page state changes useEffect(() => { - if (!monitorsLoaded) { + if (!overviewLoaded) { dispatch(fetchMonitorOverviewAction.get(pageState)); } // change only needs to be triggered on pageState change - }, [dispatch, pageState, monitorsLoaded]); + }, [dispatch, pageState, overviewLoaded]); // fetch overview for refresh useEffect(() => {