@@ -118,10 +118,16 @@ describe('GitLab', function () {
118
118
nock ( gitlab . apiBaseURL )
119
119
. persist ( )
120
120
. 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
+ ] ) ;
125
131
126
132
for ( const label of originalTestLabels ) {
127
133
updateScopes . push ( nock ( gitlab . apiBaseURL )
@@ -499,7 +505,7 @@ describe('GitLab', function () {
499
505
const ISSUE_TO_CREATE = {
500
506
title : 'New Issue' ,
501
507
description : 'Description of the new issue' ,
502
- labels : [ 'empty response' ] ,
508
+ labels : [ LABELS . EMPTY_RESPONSE . name ] ,
503
509
} ;
504
510
505
511
before ( async ( ) => {
@@ -530,7 +536,7 @@ describe('GitLab', function () {
530
536
const ISSUE = {
531
537
title : 'Existing Issue' ,
532
538
description : 'New comment' ,
533
- labels : [ 'page access restriction' ] ,
539
+ labels : [ LABELS . HTTP_403 . name ] ,
534
540
} ;
535
541
536
542
context ( 'when issue is closed' , ( ) => {
@@ -542,15 +548,15 @@ describe('GitLab', function () {
542
548
iid : 123 ,
543
549
title : ISSUE . title ,
544
550
description : ISSUE . description ,
545
- labels : [ { name : 'empty content' } ] ,
551
+ labels : [ { name : LABELS . EMPTY_CONTENT . name } ] ,
546
552
state : GitLab . ISSUE_STATE_CLOSED ,
547
553
} ;
548
554
549
555
const EXPECTED_REQUEST_BODY = { state_event : 'reopen' } ;
550
556
const responseIssuereopened = { iid : 123 } ;
551
557
const responseSetLabels = {
552
558
iid : 123 ,
553
- labels : [ 'page access restriction' ] ,
559
+ labels : [ LABELS . HTTP_403 . name ] ,
554
560
} ;
555
561
const responseAddcomment = { iid : 123 , id : 23 , body : ISSUE . description } ;
556
562
const { iid } = GITLAB_RESPONSE_FOR_EXISTING_ISSUE ;
@@ -565,7 +571,7 @@ describe('GitLab', function () {
565
571
. reply ( 200 , responseIssuereopened ) ;
566
572
567
573
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 ] } )
569
575
. reply ( 200 , responseSetLabels ) ;
570
576
571
577
addCommentScope = nock ( gitlab . apiBaseURL )
@@ -598,15 +604,15 @@ describe('GitLab', function () {
598
604
iid : 123 ,
599
605
title : ISSUE . title ,
600
606
description : ISSUE . description ,
601
- labels : [ { name : 'empty content' } ] ,
607
+ labels : [ { name : LABELS . EMPTY_CONTENT . name } ] ,
602
608
state : GitLab . ISSUE_STATE_OPEN ,
603
609
} ;
604
610
605
611
const EXPECTED_REQUEST_BODY = { state_event : 'reopen' } ;
606
612
const responseIssuereopened = { iid : 123 } ;
607
613
const responseSetLabels = {
608
614
iid : 123 ,
609
- labels : [ 'page access restriction' ] ,
615
+ labels : [ LABELS . HTTP_403 . name ] ,
610
616
} ;
611
617
const responseAddcomment = { iid : 123 , id : 23 , body : ISSUE . description } ;
612
618
const { iid } = GITLAB_RESPONSE_FOR_EXISTING_ISSUE ;
@@ -621,7 +627,7 @@ describe('GitLab', function () {
621
627
. reply ( 200 , responseIssuereopened ) ;
622
628
623
629
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 ] } )
625
631
. reply ( 200 , responseSetLabels ) ;
626
632
627
633
addCommentScope = nock ( gitlab . apiBaseURL )
@@ -653,7 +659,7 @@ describe('GitLab', function () {
653
659
iid : 123 ,
654
660
title : ISSUE . title ,
655
661
description : ISSUE . description ,
656
- labels : [ { name : 'page access restriction' } , { name : 'server error' } ] ,
662
+ labels : [ { name : LABELS . HTTP_403 . name } ] ,
657
663
state : GitLab . ISSUE_STATE_OPEN ,
658
664
} ;
659
665
@@ -679,7 +685,7 @@ describe('GitLab', function () {
679
685
await gitlab . createOrUpdateIssue ( {
680
686
title : ISSUE . title ,
681
687
description : ISSUE . description ,
682
- labels : [ 'page access restriction' , 'server error' ] ,
688
+ labels : [ LABELS . HTTP_403 . name ] ,
683
689
} ) ;
684
690
} ) ;
685
691
@@ -709,15 +715,15 @@ describe('GitLab', function () {
709
715
iid : 123 ,
710
716
title : ISSUE . title ,
711
717
description : ISSUE . description ,
712
- labels : [ { name : 'page access restriction' } ] ,
718
+ labels : [ { name : LABELS . HTTP_403 . name } ] ,
713
719
state : GitLab . ISSUE_STATE_OPEN ,
714
720
} ;
715
721
716
722
const EXPECTED_REQUEST_BODY = { state_event : 'reopen' } ;
717
723
const responseIssuereopened = { iid : 123 } ;
718
724
const responseSetLabels = {
719
725
iid : 123 ,
720
- labels : [ 'page access restriction' , 'empty content' ] ,
726
+ labels : [ LABELS . HTTP_403 . name , LABELS . EMPTY_CONTENT . name ] ,
721
727
} ;
722
728
const responseAddcomment = { iid : 123 , id : 23 , body : ISSUE . description } ;
723
729
const { iid } = GITLAB_RESPONSE_FOR_EXISTING_ISSUE ;
@@ -732,7 +738,7 @@ describe('GitLab', function () {
732
738
. reply ( 200 , responseIssuereopened ) ;
733
739
734
740
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 ] } )
736
742
. reply ( 200 , responseSetLabels ) ;
737
743
738
744
addCommentScope = nock ( gitlab . apiBaseURL )
@@ -742,7 +748,7 @@ describe('GitLab', function () {
742
748
await gitlab . createOrUpdateIssue ( {
743
749
title : ISSUE . title ,
744
750
description : ISSUE . description ,
745
- labels : [ 'page access restriction' , 'empty content' ] ,
751
+ labels : [ LABELS . HTTP_403 . name , LABELS . EMPTY_CONTENT . name ] ,
746
752
} ) ;
747
753
} ) ;
748
754
0 commit comments