From 593cf59d83a6bd43a2e58c42fd46aec5fba5ded9 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 13:31:31 +0800 Subject: [PATCH] [OSD] Sanitize copied share-link before validating (#1209) (#1213) Signed-off-by: Miki (cherry picked from commit 9b3878f4ee6eac2138557236e059bb6267c09f1f) Co-authored-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 bfebacfcd..fcb0f4121 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);