Merge branch 'master' into fix-treeBug-20190827

This commit is contained in:
Moyee 2019-08-27 19:52:09 +08:00 committed by GitHub
commit 8def171551
2 changed files with 4 additions and 4 deletions

View File

@ -41,7 +41,7 @@ describe('select-node', () => {
graph.emit('node:click', { item: node1 });
expect(node1.getStates().length).to.equal(1);
expect(node1.getStates()[0]).to.equal('selected');
graph.emit('keydown', { keyCode: 17 });
graph.emit('keydown', { keyCode: 16 });
graph.emit('node:click', { item: node1 });
expect(node1.getStates().length).to.equal(0);
graph.emit('node:click', { item: node1 });
@ -49,8 +49,8 @@ describe('select-node', () => {
graph.emit('node:click', { item: node2 });
expect(node2.getStates().length).to.equal(1);
expect(node2.getStates()[0]).to.equal('selected');
expect(node1.hasState('selected')).to.be.false;
graph.emit('keyup', { keyCode: 17 });
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(node2.getStates().length).to.equal(0);

View File

@ -94,7 +94,7 @@ describe('graph state controller', () => {
it('state with click-select', done => {
graph.removeEvent();
graph.addBehaviors('click-select', 'default');
graph.emit('keydown', { keyCode: 17 });
graph.emit('keydown', { keyCode: 16 });
graph.emit('node:click', { item: graph.findById('node1') });
graph.emit('node:click', { item: graph.findById('node2') });
let finished = false;