From dd582010e465b039046413d6c822616f6e62c60d Mon Sep 17 00:00:00 2001 From: "zhanning.bzn" Date: Tue, 27 Aug 2019 20:52:41 +0800 Subject: [PATCH] fix unit test --- package.json | 2 +- test/unit/behavior/select-spec.js | 2 +- test/unit/graph/controller/state-spec.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7d4604c4f3..cc1294356e 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "update": "rm -rf node_modules/ && tnpm i && rm -rf build && tnpm run build", "build": "webpack", "build-lib": "babel src --out-dir lib", - "dist": "npm run mkdir-dist && npm run build && npm run compress", + "dist": "npm run mkdir-dist && npm run build", "mkdir-dist": "node ./bin/mkdir-dist.js", "ci": "npm run lint && npm run test", "coverage": "npm run coverage-generator && npm run coverage-viewer", diff --git a/test/unit/behavior/select-spec.js b/test/unit/behavior/select-spec.js index 6a0154cd5b..0bcc8fca73 100644 --- a/test/unit/behavior/select-spec.js +++ b/test/unit/behavior/select-spec.js @@ -52,7 +52,7 @@ describe('select-node', () => { expect(node1.hasState('selected')).to.be.true; graph.emit('keyup', { keyCode: 16 }); graph.emit('node:click', { item: node1 }); - expect(node1.getStates().length).to.equal(1); + expect(node1.getStates().length).to.equal(0); expect(node2.getStates().length).to.equal(0); graph.destroy(); }); diff --git a/test/unit/graph/controller/state-spec.js b/test/unit/graph/controller/state-spec.js index b833b86c54..3822c0dcf6 100644 --- a/test/unit/graph/controller/state-spec.js +++ b/test/unit/graph/controller/state-spec.js @@ -105,10 +105,10 @@ describe('graph state controller', () => { graph.on('graphstatechange', e => { if (!finished) { expect(e.states.selected).not.to.be.undefined; - expect(e.states.selected.length).to.equal(1); + expect(e.states.selected.length).to.equal(2); } else { expect(e.states.selected).not.to.be.undefined; - expect(e.states.selected.length).to.equal(0); + expect(e.states.selected.length).to.equal(1); done(); } });