From 739fc8edf1a06084bc6e433135aa6e43dd84ddfb Mon Sep 17 00:00:00 2001 From: Scott Bishel Date: Wed, 5 Jul 2023 15:09:22 -0600 Subject: [PATCH] links now add utm_ data added cannot do exact match (#23885) Co-authored-by: Mattermost Build --- .../link_customization_e20_1_spec.js | 13 +++++++------ .../link_customization_e20_2_spec.js | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/e2e-tests/cypress/tests/integration/channels/system_console/site_configuration/link_customization_e20_1_spec.js b/e2e-tests/cypress/tests/integration/channels/system_console/site_configuration/link_customization_e20_1_spec.js index 2ccd69e7f3..9b6caed402 100644 --- a/e2e-tests/cypress/tests/integration/channels/system_console/site_configuration/link_customization_e20_1_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/system_console/site_configuration/link_customization_e20_1_spec.js @@ -21,6 +21,7 @@ describe('SupportSettings', () => { const aboutLink = 'https://mattermost.com/default-about/'; const helpLink = 'https://github.com/mattermost/platform/blob/master/doc/help/README.md'; const problemLink = 'https://forum.mattermost.com/c/trouble-shoot'; + const askCommunityLink = 'https://mattermost.com/pl/default-ask-mattermost-community'; before(() => { cy.shouldNotRunOnCloudEdition(); @@ -56,7 +57,7 @@ describe('SupportSettings', () => { ].forEach((guide) => { cy.findByText(guide.text). parent(). - should('have.attr', 'href', guide.link); + should('have.attr', 'href').and('match', new RegExp(`${guide.link}/*`)); }); }); @@ -76,7 +77,7 @@ describe('SupportSettings', () => { // * Verify that links are correct at login page guides.forEach((guide) => { cy.findByText(guide.text). - should('have.attr', 'href', guide.link); + should('have.attr', 'href').and('match', new RegExp(`${guide.link}/*`)); }); // # Visit signup page @@ -87,7 +88,7 @@ describe('SupportSettings', () => { cy.get('.hfroute-footer').scrollIntoView().should('be.visible').within(() => { guides.forEach((guide) => { cy.findByText(guide.text). - should('have.attr', 'href', guide.link); + should('have.attr', 'href').and('match', new RegExp(`${guide.link}/*`)); }); }); }); @@ -107,7 +108,7 @@ describe('SupportSettings', () => { // * Verify that terms of services link is set to default cy.findByText('Terms'). - should('have.attr', 'href', TERMS_OF_SERVICE_LINK); + should('have.attr', 'href').and('match', new RegExp(`${TERMS_OF_SERVICE_LINK}/*`)); }); it('MM-T1036 - Customization: Blank Help and Report a Problem hides options from help menu', () => { @@ -174,7 +175,7 @@ describe('SupportSettings', () => { // * Verify default link of Ask the community cy.findByText('Ask the community'). parent(). - should('have.attr', 'href', 'https://mattermost.com/pl/default-ask-mattermost-community/'); + should('have.attr', 'href').and('match', new RegExp(`${askCommunityLink}/*`)); }); }); @@ -205,7 +206,7 @@ describe('SupportSettings', () => { // * Verify report a problem link has changed cy.findByText('Report a problem'). parent(). - should('have.attr', 'href', problemLink); + should('have.attr', 'href').and('match', new RegExp(`${problemLink}/*`)); // # Click on keyboard shortcuts cy.findByText('Keyboard shortcuts').click(); diff --git a/e2e-tests/cypress/tests/integration/channels/system_console/site_configuration/link_customization_e20_2_spec.js b/e2e-tests/cypress/tests/integration/channels/system_console/site_configuration/link_customization_e20_2_spec.js index 6bc806bdc3..79c6122f6b 100644 --- a/e2e-tests/cypress/tests/integration/channels/system_console/site_configuration/link_customization_e20_2_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/system_console/site_configuration/link_customization_e20_2_spec.js @@ -53,8 +53,8 @@ describe('SupportSettings', () => { cy.uiOpenProductMenu(`About ${siteName}`); // * Verify that links do not change and they open to default pages - cy.get('#tosLink').should('contain', 'Terms of Use').and('have.attr', 'href').and('equal', FixedPublicLinks.TermsOfService); - cy.get('#privacyLink').should('contain', 'Privacy Policy').and('have.attr', 'href').and('equal', FixedPublicLinks.PrivacyPolicy); + cy.get('#tosLink').should('contain', 'Terms of Use').and('have.attr', 'href').and('match', new RegExp(`${FixedPublicLinks.TermsOfService}/*`)); + cy.get('#privacyLink').should('contain', 'Privacy Policy').and('have.attr', 'href').and('match', new RegExp(`${FixedPublicLinks.PrivacyPolicy}/*`)); }); it('MM-T1034 - Customization: Blank TOS link field (About modal)', () => { @@ -69,7 +69,7 @@ describe('SupportSettings', () => { cy.uiOpenProductMenu(`About ${siteName}`); // * Verify that tos link is set to default - cy.get('#tosLink').should('contain', 'Terms of Use').and('have.attr', 'href').and('equal', FixedPublicLinks.TermsOfService); + cy.get('#tosLink').should('contain', 'Terms of Use').and('have.attr', 'href').and('match', new RegExp(`${FixedPublicLinks.TermsOfService}/*`)); }); it('MM-T1035 - Customization Blank Privacy hides the link', () => { @@ -86,7 +86,7 @@ describe('SupportSettings', () => { cy.get('#tosLink').should('be.visible').and('contain', 'Terms of Use'); // * Verify that privacy link is there - cy.get('#privacyLink').should('contain', 'Privacy Policy').and('have.attr', 'href').and('equal', FixedPublicLinks.PrivacyPolicy); + cy.get('#privacyLink').should('contain', 'Privacy Policy').and('have.attr', 'href').and('match', new RegExp(`${FixedPublicLinks.PrivacyPolicy}/*`)); // # Logout cy.apiLogout();