-
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 issue that arrow cannot update (#5790)
- Loading branch information
Showing
4 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
packages/g6/__tests__/bugs/element-edge-update-arrow.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,38 @@ | ||
import { createGraph } from '../utils'; | ||
|
||
describe('bug: element-edge-update-arrow', () => { | ||
it('should update edge arrow', async () => { | ||
const graph = createGraph({ | ||
animation: false, | ||
data: { | ||
nodes: [ | ||
{ id: 'node-0', style: { x: 100, y: 100 } }, | ||
{ id: 'node-1', style: { x: 200, y: 100 } }, | ||
], | ||
edges: [ | ||
{ | ||
source: 'node-0', | ||
target: 'node-1', | ||
style: { startArrow: true, startArrowFill: 'red', endArrow: true, endArrowFill: 'green' }, | ||
}, | ||
], | ||
}, | ||
}); | ||
|
||
await graph.render(); | ||
|
||
await expect(graph).toMatchSnapshot(__filename); | ||
|
||
graph.updateEdgeData([ | ||
{ | ||
source: 'node-0', | ||
target: 'node-1', | ||
style: { startArrowFill: 'purple', startArrowStroke: 'blue', endArrowFill: 'pink', endArrowStroke: 'yellow' }, | ||
}, | ||
]); | ||
|
||
await graph.render(); | ||
|
||
await expect(graph).toMatchSnapshot(__filename, 'update-arrow'); | ||
}); | ||
}); |
37 changes: 37 additions & 0 deletions
37
...ges/g6/__tests__/snapshots/__tests__/bugs/element-edge-update-arrow/default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions
37
...6/__tests__/snapshots/__tests__/bugs/element-edge-update-arrow/update-arrow.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