@@ -256,7 +256,7 @@ describe('TreeService', () => {
256256 expect ( treeService . nodeExpanded$ . next ) . not . toHaveBeenCalled ( ) ;
257257 } ) ;
258258
259- it ( 'fires "loadNextLevel" event when expanding node with hasChildren property set to true' , ( ) => {
259+ it ( 'fires "loadNextLevel" event when expanding node with emitLoadNextLevel property set to true' , ( ) => {
260260 const masterTree = new Tree ( {
261261 value : 'Master' ,
262262 emitLoadNextLevel : true
@@ -350,7 +350,7 @@ describe('TreeService', () => {
350350 expect ( treeService . loadNextLevel$ . next ) . not . toHaveBeenCalled ( ) ;
351351 } ) ;
352352
353- it ( 'not fires "loadNextLevel" event if "hasChildren" is false or does not exists' , ( ) => {
353+ it ( 'not fires "loadNextLevel" event if "emitLoadNextLevel" does not exists' , ( ) => {
354354 const masterTree = new Tree ( {
355355 value : 'Master' ,
356356 } ) ;
@@ -364,5 +364,18 @@ describe('TreeService', () => {
364364 expect ( treeService . loadNextLevel$ . next ) . not . toHaveBeenCalled ( ) ;
365365 } ) ;
366366
367+ it ( 'not fires "loadNextLevel" event if "emitLoadNextLevel" is false' , ( ) => {
368+ const masterTree = new Tree ( {
369+ value : 'Master' ,
370+ emitLoadNextLevel : false
371+ } ) ;
367372
373+ masterTree . switchFoldingType ( ) ;
374+
375+ spyOn ( treeService . loadNextLevel$ , 'next' ) ;
376+
377+ treeService . fireNodeSwitchFoldingType ( masterTree ) ;
378+
379+ expect ( treeService . loadNextLevel$ . next ) . not . toHaveBeenCalled ( ) ;
380+ } ) ;
368381} ) ;
0 commit comments