File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1109,15 +1109,14 @@ function consolidatePaths() {
11091109
11101110function getParentGroup ( ) {
11111111 describe ( 'getParentGroup()' , ( ) => {
1112+ beforeEach ( ( ) => {
1113+ service . setProject ( twoStepsProjectJSON ) ;
1114+ } ) ;
11121115 it ( 'should get the parent group of an active node' , ( ) => {
1113- service . setProject ( oneBranchTwoPathsProjectJSON ) ;
1114- const parentGroup = service . getParentGroup ( 'node1' ) ;
1115- expect ( parentGroup . id ) . toEqual ( 'group1' ) ;
1116+ expect ( service . getParentGroup ( 'node1' ) . id ) . toEqual ( 'group1' ) ;
11161117 } ) ;
11171118 it ( 'should get the parent group of an inactive node' , ( ) => {
1118- service . setProject ( twoStepsProjectJSON ) ;
1119- const parentGroup = service . getParentGroup ( 'node3' ) ;
1120- expect ( parentGroup . id ) . toEqual ( 'group2' ) ;
1119+ expect ( service . getParentGroup ( 'node3' ) . id ) . toEqual ( 'group2' ) ;
11211120 } ) ;
11221121 } ) ;
11231122}
Original file line number Diff line number Diff line change @@ -722,7 +722,7 @@ export class ProjectService {
722722 return nodeIcon ;
723723 }
724724
725- getParentGroup ( nodeId = '' ) {
725+ getParentGroup ( nodeId = '' ) : any {
726726 const node = this . getNodeById ( nodeId ) ;
727727 if ( node != null ) {
728728 for ( const groupNode of this . getGroupNodes ( ) ) {
@@ -739,12 +739,10 @@ export class ProjectService {
739739 return null ;
740740 }
741741
742- getParentGroupId ( nodeId ) {
743- if ( nodeId != null ) {
744- const parentGroup = this . getParentGroup ( nodeId ) ;
745- if ( parentGroup != null ) {
746- return parentGroup . id ;
747- }
742+ getParentGroupId ( nodeId = '' ) : string {
743+ const parentGroup = this . getParentGroup ( nodeId ) ;
744+ if ( parentGroup != null ) {
745+ return parentGroup . id ;
748746 }
749747 return null ;
750748 }
You can’t perform that action at this time.
0 commit comments