Skip to content

Commit b01095e

Browse files
authored
chore(ci): treemap 测试用例没有销毁之前的实例,导致 ci 报错 (#1872)
1 parent 0ccde02 commit b01095e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/f2/test/components/treemap/index.test.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ describe('Treemap', () => {
8282
await delay(100);
8383
expect(onClick.mock.calls.length).toBe(1);
8484
expect(onClick.mock.calls[0][0].origin).toEqual({ name: '中国平安', value: 0.06, rate: 0.1 });
85+
86+
await delay(100);
87+
canvas.destroy();
8588
});
8689
it('space ', async () => {
8790
const onClick = jest.fn();
@@ -105,6 +108,8 @@ describe('Treemap', () => {
105108

106109
await delay(1000);
107110
expect(context).toMatchImageSnapshot();
111+
await delay(100);
112+
canvas.destroy();
108113
});
109114
it('select ', async () => {
110115
const { props } = (
@@ -176,6 +181,8 @@ describe('Treemap', () => {
176181
canvas.update(nextProps);
177182
await delay(1000);
178183
expect(context).toMatchImageSnapshot();
184+
await delay(100);
185+
canvas.destroy();
179186
});
180187
it('select triggerOn', async () => {
181188
const { props } = (
@@ -213,6 +220,8 @@ describe('Treemap', () => {
213220
gestureSimulator(context.canvas, 'click', { x: 250, y: 170 });
214221
await delay(800);
215222
expect(context).toMatchImageSnapshot();
223+
await delay(100);
224+
canvas.destroy();
216225
});
217226
it('反选', async () => {
218227
const { props } = (
@@ -250,6 +259,8 @@ describe('Treemap', () => {
250259
gestureSimulator(context.canvas, 'click', { x: 260, y: 170 });
251260
await delay(800);
252261
expect(context).toMatchImageSnapshot();
262+
await delay(100);
263+
canvas.destroy();
253264
});
254265
it('取消反选', async () => {
255266
const { props } = (
@@ -288,6 +299,8 @@ describe('Treemap', () => {
288299
gestureSimulator(context.canvas, 'click', { x: 260, y: 170 });
289300
await delay(800);
290301
expect(context).toMatchImageSnapshot();
302+
await delay(100);
303+
canvas.destroy();
291304
});
292305
it('多选', async () => {
293306
const { props } = (
@@ -327,5 +340,7 @@ describe('Treemap', () => {
327340
gestureSimulator(context.canvas, 'click', { x: 230, y: 170 });
328341
await delay(800);
329342
expect(context).toMatchImageSnapshot();
343+
await delay(100);
344+
canvas.destroy();
330345
});
331346
});

0 commit comments

Comments
 (0)