Skip to content

Commit

Permalink
chore(ci): treemap 测试用例没有销毁之前的实例,导致 ci 报错
Browse files Browse the repository at this point in the history
  • Loading branch information
zengyue committed Oct 27, 2023
1 parent 0ccde02 commit b684d1f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/f2/test/components/treemap/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ describe('Treemap', () => {
await delay(100);
expect(onClick.mock.calls.length).toBe(1);
expect(onClick.mock.calls[0][0].origin).toEqual({ name: '中国平安', value: 0.06, rate: 0.1 });

await delay(100);
canvas.destroy();
});
it('space ', async () => {
const onClick = jest.fn();
Expand All @@ -105,6 +108,8 @@ describe('Treemap', () => {

await delay(1000);
expect(context).toMatchImageSnapshot();
await delay(100);
canvas.destroy();
});
it('select ', async () => {
const { props } = (
Expand Down Expand Up @@ -176,6 +181,8 @@ describe('Treemap', () => {
canvas.update(nextProps);
await delay(1000);
expect(context).toMatchImageSnapshot();
await delay(100);
canvas.destroy();
});
it('select triggerOn', async () => {
const { props } = (
Expand Down Expand Up @@ -213,6 +220,8 @@ describe('Treemap', () => {
gestureSimulator(context.canvas, 'click', { x: 250, y: 170 });
await delay(800);
expect(context).toMatchImageSnapshot();
await delay(100);
canvas.destroy();
});
it('反选', async () => {
const { props } = (
Expand Down Expand Up @@ -250,6 +259,8 @@ describe('Treemap', () => {
gestureSimulator(context.canvas, 'click', { x: 260, y: 170 });
await delay(800);
expect(context).toMatchImageSnapshot();
await delay(100);
canvas.destroy();
});
it('取消反选', async () => {
const { props } = (
Expand Down Expand Up @@ -288,6 +299,8 @@ describe('Treemap', () => {
gestureSimulator(context.canvas, 'click', { x: 260, y: 170 });
await delay(800);
expect(context).toMatchImageSnapshot();
await delay(100);
canvas.destroy();
});
it('多选', async () => {
const { props } = (
Expand Down Expand Up @@ -327,5 +340,7 @@ describe('Treemap', () => {
gestureSimulator(context.canvas, 'click', { x: 230, y: 170 });
await delay(800);
expect(context).toMatchImageSnapshot();
await delay(100);
canvas.destroy();
});
});

0 comments on commit b684d1f

Please sign in to comment.