fix: Add template id to workflows created from templates (no-changelog) (#8226)

In #8088 template ID was added to workflow metadata, but it was missing
from workflows that were created using the template credential setup.
This fixes that.
This commit is contained in:
Tomi Turtiainen
2024-01-05 10:36:59 +02:00
committed by GitHub
parent 071e6d6b6e
commit 8a78ae1739
2 changed files with 20 additions and 1 deletions

View File

@@ -106,6 +106,22 @@ describe('Template credentials setup', () => {
cy.wait('@createWorkflow');
workflowPage.getters.canvasNodes().should('have.length', 3);
// Focus the canvas so the copy to clipboard works
workflowPage.getters.canvasNodes().eq(0).realClick();
workflowPage.actions.selectAll();
workflowPage.actions.hitCopy();
cy.grantBrowserPermissions('clipboardReadWrite', 'clipboardSanitizedWrite');
// Check workflow JSON by copying it to clipboard
cy.readClipboard().then((workflowJSON) => {
const workflow = JSON.parse(workflowJSON);
expect(workflow.meta).to.haveOwnProperty('templateId', testTemplate.id.toString());
workflow.nodes.forEach((node: any) => {
expect(Object.keys(node.credentials ?? {})).to.have.lengthOf(1);
});
});
});
it('should work with a template that has no credentials (ADO-1603)', () => {