fix(editor): Send protocol and n8n version in templates destination parameter, stop redirecting template preview page to website (#8691)

This commit is contained in:
Milorad FIlipović
2024-02-21 13:09:16 +01:00
committed by GitHub
parent 5304b320c8
commit a573146135
4 changed files with 23 additions and 22 deletions

View File

@@ -25,6 +25,13 @@ describe('Workflow templates', () => {
mainSidebar.getters.menuItem('Templates').should('be.visible');
// Templates should be a link to the website
mainSidebar.getters.templates().parent('a').should('have.attr', 'href').and('include', 'https://n8n.io/workflows');
// Link should contain instance address and n8n version
mainSidebar.getters.templates().parent('a').then(($a) => {
const href = $a.attr('href');
// Link should have current instance address and n8n version
expect(href).to.include(`utm_instance=${window.location.origin}`);
expect(href).to.match(/utm_n8n_version=[0-9]+\.[0-9]+\.[0-9]+/);
});
mainSidebar.getters.templates().parent('a').should('have.attr', 'target', '_blank');
});
@@ -34,11 +41,4 @@ describe('Workflow templates', () => {
cy.url().should('include', 'https://n8n.io/workflows');
})
});
it('Redirects to website when visiting template by id page directly', () => {
cy.visit(`${templatesPage.url}/1`);
cy.origin('https://n8n.io', () => {
cy.url().should('include', 'https://n8n.io/workflows/1');
})
});
});