@@ -283,7 +283,7 @@ describe('utils', () => {
283283 } ) ;
284284
285285 describe ( 'Mirror' , ( ) => {
286- describe ( 'removeNodeFromMapPermanently ' , ( ) => {
286+ describe ( 'removeNodeFromMap with permanent flag ' , ( ) => {
287287 it ( 'should remove node from both idNodeMap and nodeMetaMap' , ( ) => {
288288 const mirror = new Mirror ( ) ;
289289 const div = document . createElement ( 'div' ) ;
@@ -300,7 +300,7 @@ describe('utils', () => {
300300 expect ( mirror . hasNode ( div ) ) . toBe ( true ) ;
301301 expect ( mirror . getNode ( 1 ) ) . toBe ( div ) ;
302302
303- mirror . removeNodeFromMapPermanently ( div ) ;
303+ mirror . removeNodeFromMap ( div , true ) ;
304304
305305 expect ( mirror . getId ( div ) ) . toBe ( - 1 ) ;
306306 expect ( mirror . hasNode ( div ) ) . toBe ( false ) ;
@@ -358,7 +358,7 @@ describe('utils', () => {
358358 expect ( mirror . hasNode ( child2 ) ) . toBe ( true ) ;
359359 expect ( mirror . hasNode ( grandchild ) ) . toBe ( true ) ;
360360
361- mirror . removeNodeFromMapPermanently ( parent ) ;
361+ mirror . removeNodeFromMap ( parent , true ) ;
362362
363363 expect ( mirror . hasNode ( parent ) ) . toBe ( false ) ;
364364 expect ( mirror . hasNode ( child1 ) ) . toBe ( false ) ;
@@ -370,7 +370,7 @@ describe('utils', () => {
370370 expect ( mirror . getId ( grandchild ) ) . toBe ( - 1 ) ;
371371 } ) ;
372372
373- it ( 'should differ from removeNodeFromMap by also clearing nodeMetaMap' , ( ) => {
373+ it ( 'should differ from non-permanent removeNodeFromMap by also clearing nodeMetaMap' , ( ) => {
374374 const mirror1 = new Mirror ( ) ;
375375 const div1 = document . createElement ( 'div' ) ;
376376 const meta1 = {
@@ -399,9 +399,9 @@ describe('utils', () => {
399399 } as serializedNodeWithId ;
400400
401401 mirror2 . add ( div2 , meta2 ) ;
402- mirror2 . removeNodeFromMapPermanently ( div2 ) ;
402+ mirror2 . removeNodeFromMap ( div2 , true ) ;
403403
404- // removeNodeFromMapPermanently clears both maps
404+ // removeNodeFromMap with permanent=true clears both maps
405405 expect ( mirror2 . getNode ( 1 ) ) . toBeNull ( ) ;
406406 expect ( mirror2 . hasNode ( div2 ) ) . toBe ( false ) ; // Also removed from nodeMetaMap
407407 } ) ;
0 commit comments