diff --git a/cypress/e2e/6-code-node.cy.ts b/cypress/e2e/6-code-node.cy.ts index cf3752aeddb12..74e775453b82b 100644 --- a/cypress/e2e/6-code-node.cy.ts +++ b/cypress/e2e/6-code-node.cy.ts @@ -1,4 +1,4 @@ -import { randomString } from 'n8n-workflow'; +import { nanoid } from 'nanoid'; import { WorkflowPage as WorkflowPageClass } from '../pages/workflow'; import { NDV } from '../pages/ndv'; import { successToast } from '../pages/notifications'; @@ -86,7 +86,7 @@ describe('Code node', () => { cy.getByTestId('ask-ai-cta-tooltip-no-prompt').should('exist'); cy.getByTestId('ask-ai-prompt-input') // Type random 14 character string - .type(randomString(14)); + .type(nanoid(14)); cy.getByTestId('ask-ai-cta').realHover(); cy.getByTestId('ask-ai-cta-tooltip-prompt-too-short').should('exist'); @@ -94,14 +94,14 @@ describe('Code node', () => { cy.getByTestId('ask-ai-prompt-input') .clear() // Type random 15 character string - .type(randomString(15)); + .type(nanoid(15)); cy.getByTestId('ask-ai-cta').should('be.enabled'); cy.getByTestId('ask-ai-prompt-counter').should('contain.text', '15 / 600'); }); it('should send correct schema and replace code', () => { - const prompt = randomString(20); + const prompt = nanoid(20); cy.get('#tab-ask-ai').click(); ndv.actions.executePrevious(); @@ -131,7 +131,7 @@ describe('Code node', () => { }); it('should show error based on status code', () => { - const prompt = randomString(20); + const prompt = nanoid(20); cy.get('#tab-ask-ai').click(); ndv.actions.executePrevious(); diff --git a/cypress/package.json b/cypress/package.json index 96378e428774c..7740b5483f01b 100644 --- a/cypress/package.json +++ b/cypress/package.json @@ -15,7 +15,8 @@ }, "devDependencies": { "@types/lodash": "^4.14.195", - "eslint-plugin-cypress": "^3.3.0" + "eslint-plugin-cypress": "^3.3.0", + "n8n-workflow": "workspace:*" }, "dependencies": { "@ngneat/falso": "^7.2.0", @@ -25,7 +26,6 @@ "cypress-real-events": "^1.12.0", "lodash": "4.17.21", "nanoid": "3.3.6", - "n8n-workflow": "workspace:*", "start-server-and-test": "^2.0.3" } } diff --git a/cypress/utils/executions.ts b/cypress/utils/executions.ts index e40f52ed1b924..e42e2152d6d80 100644 --- a/cypress/utils/executions.ts +++ b/cypress/utils/executions.ts @@ -1,10 +1,5 @@ -import { - randomString, - type IDataObject, - type IPinData, - type ITaskData, - type ITaskDataConnections, -} from 'n8n-workflow'; +import { nanoid } from 'nanoid'; +import type { IDataObject, IPinData, ITaskData, ITaskDataConnections } from 'n8n-workflow'; import { clickExecuteWorkflowButton } from '../composables/workflow'; export function createMockNodeExecutionData( @@ -91,7 +86,7 @@ export function runMockWorkflowExecution({ runData: Array>; workflowExecutionData?: ReturnType; }) { - const executionId = randomString(8); + const executionId = nanoid(8); cy.intercept('POST', '/rest/workflows/**/run', { statusCode: 201, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6d8dad57977aa..95e37deb5d745 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -137,9 +137,6 @@ importers: lodash: specifier: 4.17.21 version: 4.17.21 - n8n-workflow: - specifier: workspace:* - version: link:../packages/workflow nanoid: specifier: 3.3.6 version: 3.3.6 @@ -153,6 +150,9 @@ importers: eslint-plugin-cypress: specifier: ^3.3.0 version: 3.3.0(eslint@8.57.0) + n8n-workflow: + specifier: workspace:* + version: link:../packages/workflow packages/@n8n/chat: dependencies: