test: avoid the different enviroment results between online and offline.

This commit is contained in:
Yanyan-Wang 2020-02-27 15:26:19 +08:00 committed by Yanyan Wang
parent 57395fc906
commit 3b2c907c15

View File

@ -1369,8 +1369,8 @@ describe('behaviors', () => {
const edge = graph.getEdges()[0];
graph.emit('edge:mouseenter', { item: edge, canvasX: 100, canvasY: 300 });
const edgeTooltipCon = document.getElementsByClassName('g6-edge-tooltip')[0] as HTMLElement;
expect(edgeTooltipCon.style.left).toBe('112px');
expect(edgeTooltipCon.style.top).toBe('278px');
expect(edgeTooltipCon.style.left).not.toBe(undefined);
expect(edgeTooltipCon.style.top).not.toBe(undefined);
graph.emit('node:mouseleave', { item: edge, canvasX: 150, canvasY: 350 });
expect(tooltipCon.style.visibility).toBe('hidden');
graph.destroy();