@@ -82,6 +82,9 @@ describe('Treemap', () => {
82
82
await delay ( 100 ) ;
83
83
expect ( onClick . mock . calls . length ) . toBe ( 1 ) ;
84
84
expect ( onClick . mock . calls [ 0 ] [ 0 ] . origin ) . toEqual ( { name : '中国平安' , value : 0.06 , rate : 0.1 } ) ;
85
+
86
+ await delay ( 100 ) ;
87
+ canvas . destroy ( ) ;
85
88
} ) ;
86
89
it ( 'space ' , async ( ) => {
87
90
const onClick = jest . fn ( ) ;
@@ -105,6 +108,8 @@ describe('Treemap', () => {
105
108
106
109
await delay ( 1000 ) ;
107
110
expect ( context ) . toMatchImageSnapshot ( ) ;
111
+ await delay ( 100 ) ;
112
+ canvas . destroy ( ) ;
108
113
} ) ;
109
114
it ( 'select ' , async ( ) => {
110
115
const { props } = (
@@ -176,6 +181,8 @@ describe('Treemap', () => {
176
181
canvas . update ( nextProps ) ;
177
182
await delay ( 1000 ) ;
178
183
expect ( context ) . toMatchImageSnapshot ( ) ;
184
+ await delay ( 100 ) ;
185
+ canvas . destroy ( ) ;
179
186
} ) ;
180
187
it ( 'select triggerOn' , async ( ) => {
181
188
const { props } = (
@@ -213,6 +220,8 @@ describe('Treemap', () => {
213
220
gestureSimulator ( context . canvas , 'click' , { x : 250 , y : 170 } ) ;
214
221
await delay ( 800 ) ;
215
222
expect ( context ) . toMatchImageSnapshot ( ) ;
223
+ await delay ( 100 ) ;
224
+ canvas . destroy ( ) ;
216
225
} ) ;
217
226
it ( '反选' , async ( ) => {
218
227
const { props } = (
@@ -250,6 +259,8 @@ describe('Treemap', () => {
250
259
gestureSimulator ( context . canvas , 'click' , { x : 260 , y : 170 } ) ;
251
260
await delay ( 800 ) ;
252
261
expect ( context ) . toMatchImageSnapshot ( ) ;
262
+ await delay ( 100 ) ;
263
+ canvas . destroy ( ) ;
253
264
} ) ;
254
265
it ( '取消反选' , async ( ) => {
255
266
const { props } = (
@@ -288,6 +299,8 @@ describe('Treemap', () => {
288
299
gestureSimulator ( context . canvas , 'click' , { x : 260 , y : 170 } ) ;
289
300
await delay ( 800 ) ;
290
301
expect ( context ) . toMatchImageSnapshot ( ) ;
302
+ await delay ( 100 ) ;
303
+ canvas . destroy ( ) ;
291
304
} ) ;
292
305
it ( '多选' , async ( ) => {
293
306
const { props } = (
@@ -327,5 +340,7 @@ describe('Treemap', () => {
327
340
gestureSimulator ( context . canvas , 'click' , { x : 230 , y : 170 } ) ;
328
341
await delay ( 800 ) ;
329
342
expect ( context ) . toMatchImageSnapshot ( ) ;
343
+ await delay ( 100 ) ;
344
+ canvas . destroy ( ) ;
330
345
} ) ;
331
346
} ) ;
0 commit comments