fix unit test

This commit is contained in:
zhanning.bzn 2019-08-27 20:52:41 +08:00
parent 7b3be40ba7
commit dd582010e4
3 changed files with 4 additions and 4 deletions

View File

@ -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",

View File

@ -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();
});

View File

@ -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();
}
});