File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
packages/devextreme-angular/tests/src/ui Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -558,4 +558,36 @@ describe('Nested DxDataGrid', () => {
558558 } , 1000 ) ;
559559 } , 1000 ) ;
560560 } ) ;
561+
562+ it ( 'should not memory leak after click if dx-data-grid is on page (T1307313)' , ( ) => {
563+ TestBed . overrideComponent ( TestContainerComponent , {
564+ set : {
565+ template : `<dx-data-grid [dataSource]="[]"></dx-data-grid>` ,
566+ } ,
567+ } ) ;
568+
569+ const fixture = TestBed . createComponent ( TestContainerComponent ) ;
570+ fixture . detectChanges ( ) ;
571+
572+ for ( let i = 0 ; i < 100 ; i ++ ) {
573+ document . body . click ( )
574+ }
575+
576+ fixture . detectChanges ( ) ;
577+ globalThis . gc ( ) ;
578+
579+ let memoryBefore = ( performance as any ) . memory ?. usedJSHeapSize
580+
581+ for ( let i = 0 ; i < 100 ; i ++ ) {
582+ document . body . click ( )
583+ }
584+
585+ fixture . detectChanges ( ) ;
586+ globalThis . gc ( ) ;
587+
588+ const memoryDiff = ( performance as any ) . memory ?. usedJSHeapSize - memoryBefore ;
589+ console . log ( '------memory---->' , memoryDiff / 1024 ) ;
590+
591+ expect ( memoryDiff <= 0 ) . toBeTruthy ( ) ;
592+ } )
561593} ) ;
You can’t perform that action at this time.
0 commit comments