-
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: fix new node invisible after invoke graph.clear (#6702)
- Loading branch information
Showing
5 changed files
with
287 additions
and
10 deletions.
There are no files selected for viewing
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,17 @@ | ||
import { elementEdgeLine } from '@@/demos'; | ||
import { createDemoGraph, sleep } from '@@/utils'; | ||
|
||
it('graph draw after clear', async () => { | ||
const graph = await createDemoGraph(elementEdgeLine); | ||
|
||
const data = graph.getData(); | ||
|
||
await graph.clear(); | ||
|
||
await sleep(200); | ||
|
||
graph.addData(data); | ||
await graph.draw(); | ||
|
||
await expect(graph).toMatchSnapshot(__filename); | ||
}); |
254 changes: 254 additions & 0 deletions
254
packages/g6/__tests__/snapshots/bugs/graph-draw-after-clear/default.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
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
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