From 73f6db1b968c3c164ef2554851cf8c3bd97e5987 Mon Sep 17 00:00:00 2001 From: "Qingyang(Abby) Hu" Date: Sun, 21 Jan 2024 19:05:05 -0800 Subject: [PATCH] add suppress observer (#969) Signed-off-by: Qingyang(Abby) Hu --- .../apps/vis_type_table/embed.spec.js | 8 ++++++++ .../plugins/observability-dashboards/constants.js | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js index 4ddaee868..071a5b67f 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js @@ -48,6 +48,13 @@ describe('table visualization in embedded mode', () => { '115', ]; + const suppressResizeObserverIssue = () => { + // exception is thrown on loading EuiDataGrid in cypress only, ignore for now + cy.on('uncaught:exception', (err) => { + if (err.message.includes('ResizeObserver loop')) return false; + }); + }; + before(() => { cy.deleteIndex(TABLE_INDEX_ID); cy.deleteIndexPattern(TABLE_INDEX_PATTERN); @@ -153,6 +160,7 @@ describe('table visualization in embedded mode', () => { expect(data).to.deep.eq(expectedData); }); cy.tbClickTableCellAction(2, 0, 0, 'expand', 0, true); + suppressResizeObserverIssue(); cy.tbClickFilterFromExpand('filter out'); cy.reload(); cy.tbGetTableDataFromVisualization().then((data) => { diff --git a/cypress/utils/plugins/observability-dashboards/constants.js b/cypress/utils/plugins/observability-dashboards/constants.js index 6041c929d..4b9ace2c3 100644 --- a/cypress/utils/plugins/observability-dashboards/constants.js +++ b/cypress/utils/plugins/observability-dashboards/constants.js @@ -43,7 +43,7 @@ export const testIndexDataSet = [ }, ]; -export const supressResizeObserverIssue = () => { +export const suppressResizeObserverIssue = () => { // exception is thrown on loading EuiDataGrid in cypress only, ignore for now cy.on('uncaught:exception', (err) => { if (err.message.includes('ResizeObserver loop')) return false; @@ -185,7 +185,7 @@ export const landOnEventVisualizations = () => { cy.get('button[id="main-content-vis"]', { timeout: TIMEOUT_DELAY }) .contains('Visualizations') .click(); - supressResizeObserverIssue(); + suppressResizeObserverIssue(); cy.wait(delayTime); }; @@ -256,7 +256,7 @@ export const moveToCreatePage = () => { }) .eq(0) .click(); - supressResizeObserverIssue(); + suppressResizeObserverIssue(); cy.wait(delayTime * 2); cy.get('[data-test-subj="createPageTitle"]', { timeout: TIMEOUT_DELAY, @@ -267,7 +267,7 @@ export const moveToApplication = (name) => { cy.visit(`${BASE_PATH}/app/observability-applications#`, { waitForGetTenant: true, }); - supressResizeObserverIssue(); + suppressResizeObserverIssue(); cy.wait(delayTime * 2); cy.get(`[data-test-subj="${name}ApplicationLink"]`, { timeout: TIMEOUT_DELAY, @@ -286,7 +286,7 @@ export const moveToEditPage = () => { cy.get('[data-test-subj="editApplicationButton"]', { timeout: TIMEOUT_DELAY, }).click(); - supressResizeObserverIssue(); + suppressResizeObserverIssue(); cy.wait(delayTime); cy.get('[data-test-subj="createPageTitle"]', { timeout: TIMEOUT_DELAY,