test(editor): Update templates tests for new canvas (no-changelog) (#12246)
Some checks failed
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Has been cancelled

This commit is contained in:
Milorad FIlipović 2024-12-16 16:58:43 +01:00 committed by GitHub
parent e98c7f160b
commit 3af93b945f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 8 deletions

View file

@ -129,7 +129,6 @@ describe('Workflow templates', () => {
workflowPage.actions.shouldHaveWorkflowName('Demo: ' + OnboardingWorkflow.name);
workflowPage.getters.canvasNodes().should('have.length', 4);
workflowPage.getters.stickies().should('have.length', 1);
workflowPage.getters.canvasNodes().first().should('have.descendants', '.node-pin-data-icon');
});
it('can import template', () => {
@ -142,6 +141,7 @@ describe('Workflow templates', () => {
});
it('should save template id with the workflow', () => {
cy.intercept('POST', '/rest/workflows').as('saveWorkflow');
templatesPage.actions.importTemplate();
cy.visit(templatesPage.url);
@ -159,10 +159,8 @@ describe('Workflow templates', () => {
workflowPage.actions.hitSelectAll();
workflowPage.actions.hitCopy();
cy.grantBrowserPermissions('clipboardReadWrite', 'clipboardSanitizedWrite');
// Check workflow JSON by copying it to clipboard
cy.readClipboard().then((workflowJSON) => {
expect(workflowJSON).to.contain('"templateId": "1"');
cy.wait('@saveWorkflow').then((interception) => {
expect(interception.request.body.meta.templateId).to.equal('1');
});
});

View file

@ -32,7 +32,11 @@ export class WorkflowPage extends BasePage {
canvasNodes: () =>
cy.ifCanvasVersion(
() => cy.getByTestId('canvas-node'),
() => cy.getByTestId('canvas-node').not('[data-node-type="n8n-nodes-internal.addNodes"]'),
() =>
cy
.getByTestId('canvas-node')
.not('[data-node-type="n8n-nodes-internal.addNodes"]')
.not('[data-node-type="n8n-nodes-base.stickyNote"]'),
),
canvasNodeByName: (nodeName: string) =>
this.getters.canvasNodes().filter(`:contains(${nodeName})`),

View file

@ -103,7 +103,7 @@ onBeforeUnmount(() => {
v-bind="$attrs"
:id="id"
:class="classes"
data-test-id="canvas-sticky-note-node"
data-test-id="sticky"
:height="renderOptions.height"
:width="renderOptions.width"
:model-value="renderOptions.content"

View file

@ -9,7 +9,7 @@ exports[`CanvasNodeStickyNote > should render node correctly 1`] = `
<div class="vue-flow__resize-control nodrag top right handle"></div>
<div class="vue-flow__resize-control nodrag bottom left handle"></div>
<div class="vue-flow__resize-control nodrag bottom right handle"></div>
<div class="n8n-sticky sticky clickable color-1 sticky" style="height: 180px; width: 240px;" data-test-id="canvas-sticky-note-node">
<div class="n8n-sticky sticky clickable color-1 sticky" style="height: 180px; width: 240px;" data-test-id="sticky">
<div class="wrapper">
<div class="n8n-markdown">
<div class="sticky"></div>