mirror of
https://gitee.com/antv/g6.git
synced 2024-12-05 05:09:07 +08:00
fix unit test
This commit is contained in:
parent
7b3be40ba7
commit
dd582010e4
@ -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",
|
||||
|
@ -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();
|
||||
});
|
||||
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user