11import request from 'supertest' ;
2- import { describe , it , expect , beforeAll , afterAll , afterEach , vi } from 'vitest' ;
2+ import { afterAll , afterEach , beforeAll , describe , expect , it , vi } from 'vitest' ;
33import * as db from '../src/db' ;
44import service from '../src/service' ;
55import Proxy from '../src/proxy' ;
@@ -268,7 +268,13 @@ describe('Push API', () => {
268268 await loginAsApprover ( ) ;
269269 const res = await request ( app )
270270 . post ( `/api/v1/push/${ TEST_PUSH . id } /reject` )
271- . set ( 'Cookie' , `${ cookie } ` ) ;
271+ . set ( 'Cookie' , `${ cookie } ` )
272+ . send ( {
273+ params : {
274+ reason : 'tests did not pass' ,
275+ } ,
276+ } ) ;
277+
272278 expect ( res . status ) . toBe ( 200 ) ;
273279 } ) ;
274280
@@ -281,7 +287,12 @@ describe('Push API', () => {
281287 await loginAsApprover ( ) ;
282288 const res = await request ( app )
283289 . post ( `/api/v1/push/${ TEST_PUSH . id } /reject` )
284- . set ( 'Cookie' , `${ cookie } ` ) ;
290+ . set ( 'Cookie' , `${ cookie } ` )
291+ . send ( {
292+ params : {
293+ reason : 'tests did not pass' ,
294+ } ,
295+ } ) ;
285296 expect ( res . status ) . toBe ( 401 ) ;
286297 } ) ;
287298
@@ -290,7 +301,13 @@ describe('Push API', () => {
290301 await loginAsCommitter ( ) ;
291302 const res = await request ( app )
292303 . post ( `/api/v1/push/${ TEST_PUSH . id } /reject` )
293- . set ( 'Cookie' , `${ cookie } ` ) ;
304+ . set ( 'Cookie' , `${ cookie } ` )
305+ . send ( {
306+ params : {
307+ reason : 'tests did not pass' ,
308+ } ,
309+ } ) ;
310+
294311 expect ( res . status ) . toBe ( 401 ) ;
295312 } ) ;
296313
0 commit comments