forked from antvis/G6
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fbc64ff
commit a45a9e2
Showing
4 changed files
with
45 additions
and
3 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
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
38 changes: 38 additions & 0 deletions
38
packages/g6/tests/integration/plugins-edgeFilterLens.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 { resetEntityCounter } from '@antv/g'; | ||
import EdgeFilterLens from '../demo/plugins/edgeFilterLens'; | ||
import { createContext, sleep } from './utils'; | ||
import { triggerEvent } from './utils/event'; | ||
import './utils/useSnapshotMatchers'; | ||
|
||
describe('Default EdgeFilterLens', () => { | ||
beforeEach(() => { | ||
resetEntityCounter(); | ||
}); | ||
|
||
it('should be rendered correctly with Canvas2D', async () => { | ||
const dir = `${__dirname}/snapshots/canvas/plugins/edgeFilterLens`; | ||
const { backgroundCanvas, canvas, transientCanvas, container } = | ||
createContext('canvas', 500, 500); | ||
const graph = await EdgeFilterLens({ | ||
backgroundCanvas, | ||
canvas, | ||
transientCanvas, | ||
width: 500, | ||
height: 500, | ||
container, | ||
}); | ||
|
||
const process = new Promise((reslove) => { | ||
graph.on('afterlayout', reslove); | ||
}) | ||
|
||
await process; | ||
await sleep(300); | ||
triggerEvent(graph, 'mousedown', 100, 100); | ||
await expect(canvas).toMatchCanvasSnapshot( | ||
dir, | ||
'plugins-edge-filter-lens', | ||
); | ||
graph.destroy(); | ||
}); | ||
}); |
Binary file added
BIN
+98.5 KB
...ntegration/snapshots/canvas/plugins/edgeFilterLens/plugins-edge-filter-lens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.