@@ -661,6 +661,41 @@ describe('Pull Request Label Check', () => {
661
661
} ) ;
662
662
} ) ;
663
663
664
+ describe ( 'when hotfix label gets added' , ( ) => {
665
+ const label = {
666
+ id : 638839900 ,
667
+ node_id : 'MDU6TGFiZWw2Mzg4Mzk5MDA=' ,
668
+ url : 'https://api.github.com/repos/oppia/oppia/labels/PR:%20released' ,
669
+ name : 'PR: Needs to be hotfixed' ,
670
+ color : '00FF00' ,
671
+ } ;
672
+
673
+ beforeEach ( async ( ) => {
674
+ payloadData . payload . action = 'labeled' ;
675
+ payloadData . payload . label = label ;
676
+ spyOn ( checkPullRequestLabelModule , 'checkHotfixLabel' ) . and . callThrough ( ) ;
677
+ await robot . receive ( payloadData ) ;
678
+ } ) ;
679
+
680
+ it ( 'should check for hotfix label' , ( ) => {
681
+ expect ( checkPullRequestLabelModule . checkHotfixLabel ) . toHaveBeenCalled ( ) ;
682
+ } ) ;
683
+
684
+ it ( 'should comment on PR' , ( ) => {
685
+ expect ( github . issues . createComment ) . toHaveBeenCalled ( ) ;
686
+ expect ( github . issues . createComment ) . toHaveBeenCalledWith ( {
687
+ body :
688
+ 'Hi, @oppia/release-coordinators flagging this pull request for ' +
689
+ 'for your attention since this is labelled as a hotfix PR. ' +
690
+ 'Please ensure that you add the "PR: for current release" ' +
691
+ 'label if the next release is in progress. Thanks!' ,
692
+ number : payloadData . payload . pull_request . number ,
693
+ owner : payloadData . payload . repository . owner . login ,
694
+ repo : payloadData . payload . repository . name
695
+ } )
696
+ } )
697
+ } ) ;
698
+
664
699
describe ( 'when another label gets removed' , ( ) => {
665
700
const label = {
666
701
id : 638839900 ,
0 commit comments