File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 11import { TwitchChat } from '../../services/TwitchChat' ;
22import { StreamLabs } from '../../services/StreamLabs' ;
33import { MergeRequestMerged } from './merge-request-merged' ;
4- import { Reaction } from '../github/reaction' ;
54import { MergeRequestPayload } from '../../schemas/gitlab/merge-request-payload' ;
5+ import { MergeRequestOpened } from './merge-request-opened' ;
6+ import { Reaction } from '../github/reaction' ;
67
78export const buildGitLabReactions = (
89 twitchChat : TwitchChat ,
910 streamlabs : StreamLabs ,
1011) : Reaction < MergeRequestPayload > [ ] => {
11- return [ new MergeRequestMerged ( twitchChat , streamlabs ) ] ;
12+ return [
13+ new MergeRequestMerged ( twitchChat , streamlabs ) ,
14+ new MergeRequestOpened ( twitchChat , streamlabs ) ,
15+ ] ;
1216} ;
Original file line number Diff line number Diff line change @@ -32,5 +32,21 @@ describe('POST /gitlab', () => {
3232
3333 expect ( result ) . toEqual ( expect . objectContaining ( { messages : expect . anything ( ) } ) ) ;
3434 } ) ;
35+
36+ it ( 'handles merge request opened event' , async ( ) => {
37+ const subject = await initServer ( getConfig ( ) ) ;
38+ const payload = new MergeRequestPayloadBuilder ( )
39+ . with ( { object_attributes : { state : 'opened' } } )
40+ . getInstance ( ) ;
41+
42+ const { result } = await subject . inject ( {
43+ method : 'POST' ,
44+ url : '/gitlab' ,
45+ payload,
46+ headers : { 'x-gitlab-event' : 'Merge Request Hook' } ,
47+ } ) ;
48+
49+ expect ( result ) . toEqual ( expect . objectContaining ( { messages : expect . anything ( ) } ) ) ;
50+ } ) ;
3551 } ) ;
3652} ) ;
You can’t perform that action at this time.
0 commit comments