File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -373,6 +373,33 @@ describe('JobsManager', () => {
373373 } ) ;
374374 } ) ;
375375
376+ it ( 'should set the `external_id` parameter correctly' , ( done ) => {
377+ nock . cleanAll ( ) ;
378+ let boundary : string | null = null ;
379+ const external_id = 'some_job_correlation_id' ;
380+
381+ const request = nock ( API_URL )
382+ . matchHeader ( 'Content-Type' , ( header ) => {
383+ boundary = `--${ header . match ( / b o u n d a r y = ( [ ^ \n ] * ) / ) ?. [ 1 ] } ` ;
384+
385+ return true ;
386+ } )
387+ . post ( '/jobs/users-imports' , ( body ) => {
388+ const parts = extractParts ( body , boundary ) ;
389+
390+ expect ( parts . external_id ) . toBe ( external_id ) ;
391+
392+ return true ;
393+ } )
394+ . reply ( 200 , { } ) ;
395+
396+ jobs . importUsers ( Object . assign ( { } , data , { external_id } ) ) . then ( ( ) => {
397+ expect ( request . isDone ( ) ) . toBe ( true ) ;
398+
399+ done ( ) ;
400+ } ) ;
401+ } ) ;
402+
376403 it ( 'should include the token in the Authorization header' , ( done ) => {
377404 nock . cleanAll ( ) ;
378405
You can’t perform that action at this time.
0 commit comments