-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(minimap): fix collapsed combo childrenNode getShape not found (#6120
) Co-authored-by: 王璨 <[email protected]>
- Loading branch information
Showing
4 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
packages/g6/__tests__/bugs/plugin-minimap-combo-collapsed.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { createGraph, sleep } from '@@/utils'; | ||
|
||
describe('bug: plugin-minimap-combo-collapsed', () => { | ||
it('should be collapsed', async () => { | ||
const graph = createGraph({ | ||
animation: false, | ||
data: { | ||
nodes: [{ id: 'node1', combo: 'combo1' }, { id: 'node2' }], | ||
edges: [{ source: 'node1', target: 'node2' }], | ||
combos: [{ id: 'combo1' }], | ||
}, | ||
layout: { | ||
type: 'grid', | ||
}, | ||
plugins: [ | ||
{ | ||
key: 'minimap', | ||
type: 'minimap', | ||
size: [240, 160], | ||
}, | ||
], | ||
}); | ||
|
||
await graph.render(); | ||
|
||
await expect(graph).toMatchSnapshot(__filename); | ||
|
||
await sleep(1000); | ||
graph.collapseElement('combo1'); | ||
graph.translateElementBy('combo1', [100, 100]); | ||
|
||
await graph.render(); | ||
|
||
await expect(graph).toMatchSnapshot(__filename, 'update collapsed combo'); | ||
}); | ||
}); |
31 changes: 31 additions & 0 deletions
31
packages/g6/__tests__/snapshots/bugs/plugin-minimap-combo-collapsed/default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions
33
...ests__/snapshots/bugs/plugin-minimap-combo-collapsed/update collapsed combo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters