From df5c92b3d14ef575ff80459d33e277f167d82a43 Mon Sep 17 00:00:00 2001 From: Miki Date: Tue, 9 Apr 2024 16:23:11 -0700 Subject: [PATCH] [OSD] Sanitize copied share-link before validating (#1209) Signed-off-by: Miki --- .../apps/data_explorer/shared_links.spec.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js index 61b9ae7f9..92935651b 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js @@ -58,7 +58,13 @@ describe('shared links', () => { cy.getElementByTestId('shareTopNavButton').should('be.visible').click(); cy.getElementByTestId('copyShareUrlButton') .invoke('attr', 'data-share-url') - .should('eq', url) + // Even though `CURRENT_TENANT.newTenant` is set to global, that could change and hence this test will remove + // either of the tenants it sees. + .should( + 'satisfy', + (copied) => + copied.replace(/\?security_tenant=(global|private)/, '') === url + ) .then((url) => { cy.log(url); cy.request(url).its('status').should('eq', 200);