diff --git a/__tests__/integration/api-chart-emit-enable-disable-tooltip.spec.ts b/__tests__/integration/api-chart-emit-enable-disable-tooltip.spec.ts index f78abaad03..917aea0580 100644 --- a/__tests__/integration/api-chart-emit-enable-disable-tooltip.spec.ts +++ b/__tests__/integration/api-chart-emit-enable-disable-tooltip.spec.ts @@ -2,7 +2,10 @@ import './utils/useSnapshotMatchers'; import { Chart } from '../../src'; import { createNodeGCanvas } from './utils/createNodeGCanvas'; import { sleep } from './utils/sleep'; -import { dispatchFirstElementEvent, dispatchPlotEvent } from './utils/event'; +import { + dispatchFirstElementPointerMoveEvent, + dispatchPlotEvent, +} from './utils/event'; import { kebabCase } from './utils/kebabCase'; const data = [ @@ -57,7 +60,7 @@ describe('chart.emit', () => { chart.emit('tooltip:disable'); await sleep(20); - dispatchFirstElementEvent(barCanvas, 'pointermove'); + dispatchFirstElementPointerMoveEvent(barCanvas); await expect(barCanvas).toMatchDOMSnapshot(dir, 'step0', { fileFormat: 'html', selector: '.g2-tooltip', @@ -65,7 +68,7 @@ describe('chart.emit', () => { chart.emit('tooltip:enable'); - dispatchFirstElementEvent(barCanvas, 'pointermove'); + dispatchFirstElementPointerMoveEvent(barCanvas); await expect(barCanvas).toMatchDOMSnapshot(dir, 'step1', { fileFormat: 'html', selector: '.g2-tooltip', diff --git a/__tests__/integration/api-chart-emit-item-tooltip.spec.ts b/__tests__/integration/api-chart-emit-item-tooltip.spec.ts index 2ccef4f334..8fcc88d9c5 100644 --- a/__tests__/integration/api-chart-emit-item-tooltip.spec.ts +++ b/__tests__/integration/api-chart-emit-item-tooltip.spec.ts @@ -4,6 +4,7 @@ import { dispatchFirstElementEvent, createPromise, receiveExpectData, + dispatchFirstElementPointerMoveEvent, } from './utils/event'; import './utils/useSnapshotMatchers'; import { createNodeGCanvas } from './utils/createNodeGCanvas'; @@ -37,7 +38,7 @@ describe('chart.emit', () => { // chart.on("tooltip:show", callback) should revive selected data. const [tooltipShowed, resolveShow] = createPromise(); chart.on('tooltip:show', receiveExpectData(resolveShow)); - dispatchFirstElementEvent(canvas, 'pointermove'); + dispatchFirstElementPointerMoveEvent(canvas); await tooltipShowed; // chart.on("tooltip:hide") should be called when hiding tooltip. diff --git a/__tests__/integration/snapshots/api/chart-emit-enable-disable-tooltip/step1.html b/__tests__/integration/snapshots/api/chart-emit-enable-disable-tooltip/step1.html index 5c7540989c..cd6c7cf29a 100644 --- a/__tests__/integration/snapshots/api/chart-emit-enable-disable-tooltip/step1.html +++ b/__tests__/integration/snapshots/api/chart-emit-enable-disable-tooltip/step1.html @@ -1,7 +1,7 @@