@@ -118,10 +118,16 @@ describe('GitLab', function () {
118118 nock ( gitlab . apiBaseURL )
119119 . persist ( )
120120 . get ( `/projects/${ PROJECT_ID } /labels?with_counts=true` )
121- . reply ( 200 , [ ...MANAGED_LABELS . slice ( 0 , - 2 ) , ...testLabels ] . map ( label => ( {
122- ...label ,
123- description : `${ label . description } ${ MANAGED_BY_OTA_MARKER } ` ,
124- } ) ) ) ;
121+ . reply ( 200 , [
122+ ...MANAGED_LABELS . slice ( 0 , - 2 ) . map ( label => ( {
123+ ...label ,
124+ description : `${ label . description } ${ MANAGED_BY_OTA_MARKER } ` ,
125+ } ) ) ,
126+ ...testLabels . map ( label => ( {
127+ ...label ,
128+ description : `${ label . description } ${ MANAGED_BY_OTA_MARKER } ` ,
129+ } ) ) ,
130+ ] ) ;
125131
126132 for ( const label of originalTestLabels ) {
127133 updateScopes . push ( nock ( gitlab . apiBaseURL )
@@ -499,7 +505,7 @@ describe('GitLab', function () {
499505 const ISSUE_TO_CREATE = {
500506 title : 'New Issue' ,
501507 description : 'Description of the new issue' ,
502- labels : [ 'empty response' ] ,
508+ labels : [ LABELS . EMPTY_RESPONSE . name ] ,
503509 } ;
504510
505511 before ( async ( ) => {
@@ -530,7 +536,7 @@ describe('GitLab', function () {
530536 const ISSUE = {
531537 title : 'Existing Issue' ,
532538 description : 'New comment' ,
533- labels : [ 'page access restriction' ] ,
539+ labels : [ LABELS . HTTP_403 . name ] ,
534540 } ;
535541
536542 context ( 'when issue is closed' , ( ) => {
@@ -542,15 +548,15 @@ describe('GitLab', function () {
542548 iid : 123 ,
543549 title : ISSUE . title ,
544550 description : ISSUE . description ,
545- labels : [ { name : 'empty content' } ] ,
551+ labels : [ { name : LABELS . EMPTY_CONTENT . name } ] ,
546552 state : GitLab . ISSUE_STATE_CLOSED ,
547553 } ;
548554
549555 const EXPECTED_REQUEST_BODY = { state_event : 'reopen' } ;
550556 const responseIssuereopened = { iid : 123 } ;
551557 const responseSetLabels = {
552558 iid : 123 ,
553- labels : [ 'page access restriction' ] ,
559+ labels : [ LABELS . HTTP_403 . name ] ,
554560 } ;
555561 const responseAddcomment = { iid : 123 , id : 23 , body : ISSUE . description } ;
556562 const { iid } = GITLAB_RESPONSE_FOR_EXISTING_ISSUE ;
@@ -565,7 +571,7 @@ describe('GitLab', function () {
565571 . reply ( 200 , responseIssuereopened ) ;
566572
567573 setIssueLabelsScope = nock ( gitlab . apiBaseURL )
568- . put ( `/projects/${ PROJECT_ID } /issues/${ iid } ` , { labels : [ 'page access restriction' ] } )
574+ . put ( `/projects/${ PROJECT_ID } /issues/${ iid } ` , { labels : [ LABELS . HTTP_403 . name ] } )
569575 . reply ( 200 , responseSetLabels ) ;
570576
571577 addCommentScope = nock ( gitlab . apiBaseURL )
@@ -598,15 +604,15 @@ describe('GitLab', function () {
598604 iid : 123 ,
599605 title : ISSUE . title ,
600606 description : ISSUE . description ,
601- labels : [ { name : 'empty content' } ] ,
607+ labels : [ { name : LABELS . EMPTY_CONTENT . name } ] ,
602608 state : GitLab . ISSUE_STATE_OPEN ,
603609 } ;
604610
605611 const EXPECTED_REQUEST_BODY = { state_event : 'reopen' } ;
606612 const responseIssuereopened = { iid : 123 } ;
607613 const responseSetLabels = {
608614 iid : 123 ,
609- labels : [ 'page access restriction' ] ,
615+ labels : [ LABELS . HTTP_403 . name ] ,
610616 } ;
611617 const responseAddcomment = { iid : 123 , id : 23 , body : ISSUE . description } ;
612618 const { iid } = GITLAB_RESPONSE_FOR_EXISTING_ISSUE ;
@@ -621,7 +627,7 @@ describe('GitLab', function () {
621627 . reply ( 200 , responseIssuereopened ) ;
622628
623629 setIssueLabelsScope = nock ( gitlab . apiBaseURL )
624- . put ( `/projects/${ PROJECT_ID } /issues/${ iid } ` , { labels : [ 'page access restriction' ] } )
630+ . put ( `/projects/${ PROJECT_ID } /issues/${ iid } ` , { labels : [ LABELS . HTTP_403 . name ] } )
625631 . reply ( 200 , responseSetLabels ) ;
626632
627633 addCommentScope = nock ( gitlab . apiBaseURL )
@@ -653,7 +659,7 @@ describe('GitLab', function () {
653659 iid : 123 ,
654660 title : ISSUE . title ,
655661 description : ISSUE . description ,
656- labels : [ { name : 'page access restriction' } , { name : 'server error' } ] ,
662+ labels : [ { name : LABELS . HTTP_403 . name } ] ,
657663 state : GitLab . ISSUE_STATE_OPEN ,
658664 } ;
659665
@@ -679,7 +685,7 @@ describe('GitLab', function () {
679685 await gitlab . createOrUpdateIssue ( {
680686 title : ISSUE . title ,
681687 description : ISSUE . description ,
682- labels : [ 'page access restriction' , 'server error' ] ,
688+ labels : [ LABELS . HTTP_403 . name ] ,
683689 } ) ;
684690 } ) ;
685691
@@ -709,15 +715,15 @@ describe('GitLab', function () {
709715 iid : 123 ,
710716 title : ISSUE . title ,
711717 description : ISSUE . description ,
712- labels : [ { name : 'page access restriction' } ] ,
718+ labels : [ { name : LABELS . HTTP_403 . name } ] ,
713719 state : GitLab . ISSUE_STATE_OPEN ,
714720 } ;
715721
716722 const EXPECTED_REQUEST_BODY = { state_event : 'reopen' } ;
717723 const responseIssuereopened = { iid : 123 } ;
718724 const responseSetLabels = {
719725 iid : 123 ,
720- labels : [ 'page access restriction' , 'empty content' ] ,
726+ labels : [ LABELS . HTTP_403 . name , LABELS . EMPTY_CONTENT . name ] ,
721727 } ;
722728 const responseAddcomment = { iid : 123 , id : 23 , body : ISSUE . description } ;
723729 const { iid } = GITLAB_RESPONSE_FOR_EXISTING_ISSUE ;
@@ -732,7 +738,7 @@ describe('GitLab', function () {
732738 . reply ( 200 , responseIssuereopened ) ;
733739
734740 setIssueLabelsScope = nock ( gitlab . apiBaseURL )
735- . put ( `/projects/${ PROJECT_ID } /issues/${ iid } ` , { labels : [ 'page access restriction' , 'empty content' ] } )
741+ . put ( `/projects/${ PROJECT_ID } /issues/${ iid } ` , { labels : [ LABELS . HTTP_403 . name , LABELS . EMPTY_CONTENT . name ] } )
736742 . reply ( 200 , responseSetLabels ) ;
737743
738744 addCommentScope = nock ( gitlab . apiBaseURL )
@@ -742,7 +748,7 @@ describe('GitLab', function () {
742748 await gitlab . createOrUpdateIssue ( {
743749 title : ISSUE . title ,
744750 description : ISSUE . description ,
745- labels : [ 'page access restriction' , 'empty content' ] ,
751+ labels : [ LABELS . HTTP_403 . name , LABELS . EMPTY_CONTENT . name ] ,
746752 } ) ;
747753 } ) ;
748754
0 commit comments