@@ -541,17 +541,7 @@ describe('To Validate & get list of signatures of ClaGroups via API call', funct
541541 } ) . then ( ( response ) => {
542542 validate_200_Status ( response ) ;
543543 let list = response . body . githubUsernameApprovalList ;
544- let found = false ;
545- for ( let i = 0 ; i < list . length ; i ++ ) {
546- if ( list [ i ] === gitUsernameApprovalList ) {
547- expect ( list [ i ] ) . to . eql ( gitUsernameApprovalList ) ;
548- found = true ;
549- break ;
550- }
551- }
552- if ( ! found ) {
553- expect . fail ( 'GitHub Username not found in approval list' ) ;
554- }
544+ expect ( list ) . to . include ( gitUsernameApprovalList ) ;
555545 } ) ;
556546 } ) ;
557547
@@ -571,10 +561,8 @@ describe('To Validate & get list of signatures of ClaGroups via API call', funct
571561 } ) . then ( ( response ) => {
572562 validate_200_Status ( response ) ;
573563 let list = response . body . githubUsernameApprovalList ;
574- if ( list != null ) {
575- for ( let i = 0 ; i < list . length ; i ++ ) {
576- expect ( list [ i ] ) . to . not . equal ( gitUsernameApprovalList ) ;
577- }
564+ if ( list != null && list . length > 0 ) {
565+ expect ( list ) . to . not . include ( gitUsernameApprovalList ) ;
578566 }
579567 } ) ;
580568 } ) ;
@@ -595,17 +583,7 @@ describe('To Validate & get list of signatures of ClaGroups via API call', funct
595583 } ) . then ( ( response ) => {
596584 validate_200_Status ( response ) ;
597585 let list = response . body . gitlabUsernameApprovalList ;
598- let found = false ;
599- for ( let i = 0 ; i < list . length ; i ++ ) {
600- if ( list [ i ] === gitUsernameApprovalList ) {
601- expect ( list [ i ] ) . to . eql ( gitUsernameApprovalList ) ;
602- found = true ;
603- break ;
604- }
605- }
606- if ( ! found ) {
607- expect . fail ( 'GitLab Username not found in approval list' ) ;
608- }
586+ expect ( list ) . to . include ( gitUsernameApprovalList ) ;
609587 } ) ;
610588 } ) ;
611589
@@ -625,10 +603,8 @@ describe('To Validate & get list of signatures of ClaGroups via API call', funct
625603 } ) . then ( ( response ) => {
626604 validate_200_Status ( response ) ;
627605 let list = response . body . gitlabUsernameApprovalList ;
628- if ( list != null ) {
629- for ( let i = 0 ; i < list . length ; i ++ ) {
630- expect ( list [ i ] ) . to . not . equal ( gitUsernameApprovalList ) ;
631- }
606+ if ( list != null && list . length > 0 ) {
607+ expect ( list ) . to . not . include ( gitUsernameApprovalList ) ;
632608 }
633609 } ) ;
634610 } ) ;
0 commit comments