Skip to content

Commit

Permalink
fix: 修复单测报错
Browse files Browse the repository at this point in the history
  • Loading branch information
visiky committed Oct 21, 2021
1 parent e267f7f commit 561bf52
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion __tests__/unit/plots/gauge/shapes/index-spec.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
Expand Down Expand Up @@ -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,
Expand All @@ -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);
}

Expand Down

0 comments on commit 561bf52

Please sign in to comment.