From 561bf52cd560f510bd39f42fa33c3ae1cd180da8 Mon Sep 17 00:00:00 2001 From: visiky <736929286@qq.com> Date: Thu, 21 Oct 2021 19:40:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8D=95=E6=B5=8B?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __tests__/unit/plots/gauge/shapes/index-spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/__tests__/unit/plots/gauge/shapes/index-spec.ts b/__tests__/unit/plots/gauge/shapes/index-spec.ts index 4281226c53..ea491aa54d 100644 --- a/__tests__/unit/plots/gauge/shapes/index-spec.ts +++ b/__tests__/unit/plots/gauge/shapes/index-spec.ts @@ -1,6 +1,7 @@ import { IGroup } from '@antv/g2'; import { Gauge } from '../../../../../src'; import { createDiv } from '../../../../utils/dom'; +import { delay } from '../../../../utils/delay'; describe('gauge', () => { it('no indicator', async () => { @@ -105,7 +106,7 @@ describe('gauge', () => { }, []); } - it('meter gauge: custom steps', () => { + it('meter gauge: custom steps', async () => { const gauge = new Gauge(createDiv(), { type: 'meter', percent: 0.75, @@ -124,6 +125,7 @@ describe('gauge', () => { expect(getAllShapes(gauge.chart.views[0]).length).toBeGreaterThanOrEqual(steps); // 不存在交接 gauge.update({ meter: { steps }, range: { ticks: [0, 1] } }); + await delay(50); expect(getAllShapes(gauge.chart.views[0]).length).toBe(steps); }