Skip to content

Commit

Permalink
fix(behaviors): fix click select unexcept neighbor select (#5919)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aarebecca authored Jun 21, 2024
1 parent 33047a8 commit c3c2ef3
Show file tree
Hide file tree
Showing 3 changed files with 649 additions and 4 deletions.
17 changes: 17 additions & 0 deletions packages/g6/__tests__/bugs/behaviors-click-select.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { behaviorClickSelect } from '@/__tests__/demos';
import { CommonEvent, NodeEvent } from '@/src';
import { createDemoGraph } from '@@/utils';

describe('behavior click-select', () => {
it('multiple select with degree 1', async () => {
const graph = await createDemoGraph(behaviorClickSelect, { animation: false });
graph.updateBehavior({ key: 'click-select', degree: 1, multiple: true });

graph.emit(NodeEvent.CLICK, { target: { id: '29' }, targetType: 'node' });
graph.emit(CommonEvent.KEY_DOWN, { key: 'shift' });
graph.emit(NodeEvent.CLICK, { target: { id: '6' }, targetType: 'node' });
graph.emit(CommonEvent.KEY_UP, { key: 'shift' });

await expect(graph).toMatchSnapshot(__filename, 'multiple-shift-degree-1');
});
});
Loading

0 comments on commit c3c2ef3

Please sign in to comment.