From 65134b0afda7693876c2a7218b9770b586ab1466 Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 11 May 2020 22:34:14 +0200 Subject: [PATCH] fix(tests): dont start lib dev server while running tests --- cypress/integration/flow/empty.spec.js | 15 ++++----------- package.json | 25 +++++++++++++------------ 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/cypress/integration/flow/empty.spec.js b/cypress/integration/flow/empty.spec.js index 8fffb924..d378ef85 100644 --- a/cypress/integration/flow/empty.spec.js +++ b/cypress/integration/flow/empty.spec.js @@ -13,7 +13,7 @@ describe('Empty Flow Rendering', () => { .get('.react-flow__selectionpane') .trigger('mousedown', 'topLeft', { which: 1, force: true }) .trigger('mousemove', 'bottomRight', { which: 1 }) - .trigger('mouseup', 'bottomRight', { force: true }) + .trigger('mouseup', 'bottomRight', { force: true }); }); it('renders a control panel', () => { @@ -33,12 +33,8 @@ describe('Empty Flow Rendering', () => { }); it('uses lock view control', () => { - cy.get('.react-flow__controls-unlocked').click(); - cy.get('.react-flow__controls-unlocked').should('not.exist'); - - cy.get('.react-flow__controls-locked').click(); - cy.get('.react-flow__controls-locked').should('not.exist'); - }) + cy.get('.react-flow__controls-interactive').click(); + }); it('renders an empty mini map', () => { cy.get('.react-flow__minimap'); @@ -51,10 +47,7 @@ describe('Empty Flow Rendering', () => { }); it('connects nodes', () => { - cy.get('.react-flow__node') - .first() - .find('.react-flow__handle.source') - .trigger('mousedown', { which: 1 }); + cy.get('.react-flow__node').first().find('.react-flow__handle.source').trigger('mousedown', { which: 1 }); cy.get('.react-flow__node') .last() diff --git a/package.json b/package.json index 2d1a271d..af3a7aee 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,19 @@ "type": "git", "url": "https://github.com/wbkd/react-flow.git" }, + "scripts": { + "build": "rollup -c --environment NODE_ENV:production", + "start": "rollup -w -c", + "dev": "npm run build && npm start & cd example && npm start", + "start:examples": "npm run build && cd example && npm start", + "dev:wait": "start-server-and-test start:examples http-get://localhost:3000", + "build:example": "npm install && npm run build && cd example && npm install && npm run build", + "cy:run": "cypress run", + "cy:open": "cypress open", + "cypress": "npm run dev:wait cy:open", + "test": "npm run dev:wait cy:run", + "release": "release-it" + }, "dependencies": { "@welldone-software/why-did-you-render": "^4.2.0", "classnames": "^2.2.6", @@ -56,18 +69,6 @@ "peerDependencies": { "react": "^16.13.1" }, - "scripts": { - "build": "rollup -c --environment NODE_ENV:production", - "start": "rollup -w -c", - "dev": "npm run build && npm start & cd example && npm start", - "dev:wait": "start-server-and-test dev http-get://localhost:3000", - "build:example": "npm install && npm run build && cd example && npm install && npm run build", - "cy:run": "cypress run", - "cy:open": "cypress open", - "cypress": "npm run dev:wait cy:open", - "test": "npm run dev:wait cy:run", - "release": "release-it" - }, "files": [ "dist" ]