From 0277c8debc99294ceffe25d80539a7ac755684eb Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Wed, 14 Apr 2021 12:45:10 +0200 Subject: [PATCH] Cleanup --- .../components/discover_grid/constants.ts | 2 +- .../apps/dashboard/dashboard_filter_bar.ts | 24 +++++++++++++++++++ test/functional/apps/discover/_discover.ts | 1 - .../apps/discover/_doc_navigation.ts | 2 +- test/functional/apps/discover/_doc_table.ts | 2 +- test/functional/page_objects/discover_page.ts | 1 - 6 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/plugins/discover/public/application/components/discover_grid/constants.ts b/src/plugins/discover/public/application/components/discover_grid/constants.ts index 3c32df59b30de8..de2781cf159c3d 100644 --- a/src/plugins/discover/public/application/components/discover_grid/constants.ts +++ b/src/plugins/discover/public/application/components/discover_grid/constants.ts @@ -15,7 +15,7 @@ export const gridStyle = { rowHover: 'none', }; -export const pageSizeArr = [25, 50, 100, 250, 500]; +export const pageSizeArr = [25, 50, 100]; export const defaultPageSize = 25; export const toolbarVisibility = { showColumnSelector: { diff --git a/test/functional/apps/dashboard/dashboard_filter_bar.ts b/test/functional/apps/dashboard/dashboard_filter_bar.ts index af1f31aa437d21..ad7e4be9b19352 100644 --- a/test/functional/apps/dashboard/dashboard_filter_bar.ts +++ b/test/functional/apps/dashboard/dashboard_filter_bar.ts @@ -11,6 +11,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { + const dataGrid = getService('dataGrid'); const dashboardExpect = getService('dashboardExpect'); const dashboardAddPanel = getService('dashboardAddPanel'); const testSubjects = getService('testSubjects'); @@ -162,6 +163,29 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); + describe('saved search filtering', function () { + before(async () => { + await filterBar.ensureFieldEditorModalIsClosed(); + await PageObjects.dashboard.gotoDashboardLandingPage(); + await PageObjects.dashboard.clickNewDashboard(); + await PageObjects.timePicker.setDefaultDataRange(); + }); + + it('are added when a cell magnifying glass is clicked', async function () { + await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search'); + await PageObjects.dashboard.waitForRenderComplete(); + const documentCell = await dataGrid.getCellElement(1, 3); + await documentCell.click(); + const expandCellContentButton = await documentCell.findByClassName( + 'euiDataGridRowCell__expandButtonIcon' + ); + await expandCellContentButton.click(); + await testSubjects.click('filterForButton'); + const filterCount = await filterBar.getFilterCount(); + expect(filterCount).to.equal(1); + }); + }); + describe('bad filters are loaded properly', function () { before(async () => { await filterBar.ensureFieldEditorModalIsClosed(); diff --git a/test/functional/apps/discover/_discover.ts b/test/functional/apps/discover/_discover.ts index 134a03500690c8..50d4f1068e8f35 100644 --- a/test/functional/apps/discover/_discover.ts +++ b/test/functional/apps/discover/_discover.ts @@ -52,7 +52,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(time.end).to.be(PageObjects.timePicker.defaultEndTime); const rowData = await PageObjects.discover.getDocTableIndex(1); log.debug('check the newest doc timestamp in UTC (check diff timezone in last test)'); - log.debug(rowData); expect(rowData).to.contain('Sep 22, 2015 @ 23:50:13.253'); }); diff --git a/test/functional/apps/discover/_doc_navigation.ts b/test/functional/apps/discover/_doc_navigation.ts index e486b27571e14c..90d3c4eca423a6 100644 --- a/test/functional/apps/discover/_doc_navigation.ts +++ b/test/functional/apps/discover/_doc_navigation.ts @@ -56,7 +56,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); // no longer relevant as null field won't be returned in the Fields API response - it('add filter should create an exists filter if value is null (#7189)', async function () { + xit('add filter should create an exists filter if value is null (#7189)', async function () { await PageObjects.discover.waitUntilSearchingHasFinished(); // Filter special document await filterBar.addFilter('agent', 'is', 'Missing/Fields'); diff --git a/test/functional/apps/discover/_doc_table.ts b/test/functional/apps/discover/_doc_table.ts index c33133f7be2e40..1fd26b561195ee 100644 --- a/test/functional/apps/discover/_doc_table.ts +++ b/test/functional/apps/discover/_doc_table.ts @@ -38,7 +38,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToApp('discover'); }); - it('should show the records by default', async function () { + it('should show records by default', async function () { // with the default range the number of hits is ~14000 const rows = await PageObjects.discover.getDocTableRows(); expect(rows.length).to.be.greaterThan(0); diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index 1234e47e8f29dd..8dd2a4df2f4273 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -79,7 +79,6 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider public async getColumnHeaders() { return await dataGrid.getHeaderFields(); - // return await docTable.getHeaderFields('embeddedSavedSearchDocTable'); } public async openLoadSavedSearchPanel() {