From 1e178433ec95a1f57093095dcfe796f05a74ae28 Mon Sep 17 00:00:00 2001 From: lvisei Date: Wed, 20 Sep 2023 23:32:15 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B5=8B=E8=AF=95=E6=A1=88=E4=BE=8B?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/l7plot/__tests__/helper/plot.ts | 4 ++-- .../__tests__/unit/plots/heatmap/index.test.ts | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/l7plot/__tests__/helper/plot.ts b/packages/l7plot/__tests__/helper/plot.ts index 98a17a55b..09276923c 100644 --- a/packages/l7plot/__tests__/helper/plot.ts +++ b/packages/l7plot/__tests__/helper/plot.ts @@ -1,7 +1,7 @@ -import { createDiv } from './dom'; import { Plot } from '../../src/core/plot'; -import { L7PlotOptions, PlotOptions } from '../../src/types'; import { L7Plot } from '../../src/plot'; +import { L7PlotOptions, PlotOptions } from '../../src/types'; +import { createDiv } from './dom'; const mapConfig = { type: 'mapbox', diff --git a/packages/l7plot/__tests__/unit/plots/heatmap/index.test.ts b/packages/l7plot/__tests__/unit/plots/heatmap/index.test.ts index 74a8c1672..bec198993 100644 --- a/packages/l7plot/__tests__/unit/plots/heatmap/index.test.ts +++ b/packages/l7plot/__tests__/unit/plots/heatmap/index.test.ts @@ -1,7 +1,7 @@ -import { createPlot } from '../../../helper/plot'; import { Heatmap, HeatmapOptions } from '../../../../src'; import { DEFAULT_OPTIONS } from '../../../../src/plots/heatmap/constants'; import data from '../../../data-set/heat-map.json'; +import { createPlot } from '../../../helper/plot'; describe('heatmap', () => { it('defaultOptions', () => { @@ -29,8 +29,11 @@ describe('heatmap', () => { it('event', () => { const heatmap = createPlot(Heatmap, { source: { - data: [{ y: 19.1, t: 24.6, s: '海南', x: 108.6167 }], - parser: { type: 'json' }, + data: data, + parser: { type: 'geojson' }, + }, + size: { + field: 'mag', }, }); @@ -50,11 +53,11 @@ describe('heatmap', () => { it('legend', () => { const heatmap = createPlot(Heatmap, { source: { - data: [{ y: 19.1, t: 24.6, s: '海南', x: 108.6167 }], - parser: { type: 'json' }, + data: data, + parser: { type: 'geojson' }, }, size: { - field: 't', + field: 'mag', value: [0, 1], }, style: {