Skip to content

Commit

Permalink
test: add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
yvonneyx committed Aug 23, 2024
1 parent c7e6e3c commit b18a0ce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/g6/__tests__/unit/plugins/edge-filter-lens.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,10 @@ describe('edge-filter-lens', () => {
dispatchCanvasEvent(graph, CommonEvent.CLICK, { canvas: { x: 200, y: 200 } });
await expect(graph).toMatchSnapshot(__filename, 'node-type-either');
});

it('lens style', async () => {
graph.updatePlugin({ key: 'edge-filter-lens', edgeStyle: () => ({ stroke: '#f00' }) });
dispatchCanvasEvent(graph, CommonEvent.CLICK, { canvas: { x: 200, y: 200 } });
await expect(graph).toMatchSnapshot(__filename, 'lens-style');
});
});

0 comments on commit b18a0ce

Please sign in to comment.