@@ -162,61 +162,120 @@ describe('Recruiting provider operations', () => {
162162 it ( 'lists posting records through publishedJobs' , async ( ) => {
163163 mocks . json . mockResolvedValueOnce ( page ( [ requisition ( ) ] ) )
164164 mocks . json . mockResolvedValueOnce ( page ( [ { PublishedJobId : '1' , secretField : 'not-output' } ] ) )
165- const result = await operations . executeListRequisitionPostings ( { ...auth , ...{ "requisitionId" : "1" } } )
166- expect ( mocks . json ) . toHaveBeenLastCalledWith ( expect . anything ( ) , expect . objectContaining ( { address : { family : 'hcm' , relativePath : 'recruitingJobRequisitions/opaque-key/child/publishedJobs' } , query : expect . objectContaining ( { limit : 20 , offset : 0 , onlyData : true } ) } ) , undefined )
165+ const result = await operations . executeListRequisitionPostings ( {
166+ ...auth ,
167+ ...{ requisitionId : '1' } ,
168+ } )
169+ expect ( mocks . json ) . toHaveBeenLastCalledWith (
170+ expect . anything ( ) ,
171+ expect . objectContaining ( {
172+ address : {
173+ family : 'hcm' ,
174+ relativePath : 'recruitingJobRequisitions/opaque-key/child/publishedJobs' ,
175+ } ,
176+ query : expect . objectContaining ( { limit : 20 , offset : 0 , onlyData : true } ) ,
177+ } ) ,
178+ undefined
179+ )
167180 expect ( result . output . postings [ 0 ] ) . toMatchObject ( { publishedJobId : '1' } )
168181 expect ( result . output . postings [ 0 ] ) . not . toHaveProperty ( 'secretField' )
169182 } )
170183 it ( 'lists application records through recruitingJobApplications' , async ( ) => {
171184 mocks . json . mockResolvedValueOnce ( page ( [ { JobApplicationId : '1' , secretField : 'not-output' } ] ) )
172185 const result = await operations . executeListApplications ( { ...auth , ...{ } } )
173- expect ( mocks . json ) . toHaveBeenLastCalledWith ( expect . anything ( ) , expect . objectContaining ( { address : { family : 'hcm' , relativePath : 'recruitingJobApplications' } , query : expect . objectContaining ( { limit : 20 , offset : 0 , onlyData : true } ) } ) , undefined )
186+ expect ( mocks . json ) . toHaveBeenLastCalledWith (
187+ expect . anything ( ) ,
188+ expect . objectContaining ( {
189+ address : { family : 'hcm' , relativePath : 'recruitingJobApplications' } ,
190+ query : expect . objectContaining ( { limit : 20 , offset : 0 , onlyData : true } ) ,
191+ } ) ,
192+ undefined
193+ )
174194 expect ( result . output . applications [ 0 ] ) . toMatchObject ( { jobApplicationId : '1' } )
175195 expect ( result . output . applications [ 0 ] ) . not . toHaveProperty ( 'secretField' )
176196 } )
177197 it ( 'lists offer records through recruitingJobOffers' , async ( ) => {
178198 mocks . json . mockResolvedValueOnce ( page ( [ { OfferId : '1' , secretField : 'not-output' } ] ) )
179199 const result = await operations . executeListOffers ( { ...auth , ...{ } } )
180- expect ( mocks . json ) . toHaveBeenLastCalledWith ( expect . anything ( ) , expect . objectContaining ( { address : { family : 'hcm' , relativePath : 'recruitingJobOffers' } , query : expect . objectContaining ( { limit : 20 , offset : 0 , onlyData : true } ) } ) , undefined )
200+ expect ( mocks . json ) . toHaveBeenLastCalledWith (
201+ expect . anything ( ) ,
202+ expect . objectContaining ( {
203+ address : { family : 'hcm' , relativePath : 'recruitingJobOffers' } ,
204+ query : expect . objectContaining ( { limit : 20 , offset : 0 , onlyData : true } ) ,
205+ } ) ,
206+ undefined
207+ )
181208 expect ( result . output . offers [ 0 ] ) . toMatchObject ( { offerId : '1' } )
182209 expect ( result . output . offers [ 0 ] ) . not . toHaveProperty ( 'secretField' )
183210 } )
184211 it ( 'lists interview_schedule records through recruitingInterviewSchedulesLOV' , async ( ) => {
185212 mocks . json . mockResolvedValueOnce ( page ( [ { ScheduleId : '1' , secretField : 'not-output' } ] ) )
186213 const result = await operations . executeListInterviewSchedules ( { ...auth , ...{ } } )
187- expect ( mocks . json ) . toHaveBeenLastCalledWith ( expect . anything ( ) , expect . objectContaining ( { address : { family : 'hcm' , relativePath : 'recruitingInterviewSchedulesLOV' } , query : expect . objectContaining ( { limit : 20 , offset : 0 , onlyData : true } ) } ) , undefined )
214+ expect ( mocks . json ) . toHaveBeenLastCalledWith (
215+ expect . anything ( ) ,
216+ expect . objectContaining ( {
217+ address : { family : 'hcm' , relativePath : 'recruitingInterviewSchedulesLOV' } ,
218+ query : expect . objectContaining ( { limit : 20 , offset : 0 , onlyData : true } ) ,
219+ } ) ,
220+ undefined
221+ )
188222 expect ( result . output . interviewSchedules [ 0 ] ) . toMatchObject ( { scheduleId : '1' } )
189223 expect ( result . output . interviewSchedules [ 0 ] ) . not . toHaveProperty ( 'secretField' )
190224 } )
191225 it ( 'lists requisition_template records through recruitingJobRequisitionTemplatesLOV' , async ( ) => {
192226 mocks . json . mockResolvedValueOnce ( page ( [ { RequisitionId : '1' , secretField : 'not-output' } ] ) )
193227 const result = await operations . executeListRequisitionTemplates ( { ...auth , ...{ } } )
194- expect ( mocks . json ) . toHaveBeenLastCalledWith ( expect . anything ( ) , expect . objectContaining ( { address : { family : 'hcm' , relativePath : 'recruitingJobRequisitionTemplatesLOV' } , query : expect . objectContaining ( { limit : 20 , offset : 0 , onlyData : true } ) } ) , undefined )
228+ expect ( mocks . json ) . toHaveBeenLastCalledWith (
229+ expect . anything ( ) ,
230+ expect . objectContaining ( {
231+ address : { family : 'hcm' , relativePath : 'recruitingJobRequisitionTemplatesLOV' } ,
232+ query : expect . objectContaining ( { limit : 20 , offset : 0 , onlyData : true } ) ,
233+ } ) ,
234+ undefined
235+ )
195236 expect ( result . output . requisitionTemplates [ 0 ] ) . toMatchObject ( { requisitionId : '1' } )
196237 expect ( result . output . requisitionTemplates [ 0 ] ) . not . toHaveProperty ( 'secretField' )
197238 } )
198239 it ( 'lists representative records through recruitingRepresentativesLOV' , async ( ) => {
199240 mocks . json . mockResolvedValueOnce ( page ( [ { PersonId : '1' , secretField : 'not-output' } ] ) )
200241 const result = await operations . executeListRecruitingRepresentatives ( { ...auth , ...{ } } )
201- expect ( mocks . json ) . toHaveBeenLastCalledWith ( expect . anything ( ) , expect . objectContaining ( { address : { family : 'hcm' , relativePath : 'recruitingRepresentativesLOV' } , query : expect . objectContaining ( { limit : 20 , offset : 0 , onlyData : true } ) } ) , undefined )
242+ expect ( mocks . json ) . toHaveBeenLastCalledWith (
243+ expect . anything ( ) ,
244+ expect . objectContaining ( {
245+ address : { family : 'hcm' , relativePath : 'recruitingRepresentativesLOV' } ,
246+ query : expect . objectContaining ( { limit : 20 , offset : 0 , onlyData : true } ) ,
247+ } ) ,
248+ undefined
249+ )
202250 expect ( result . output . representatives [ 0 ] ) . toMatchObject ( { personId : '1' } )
203251 expect ( result . output . representatives [ 0 ] ) . not . toHaveProperty ( 'secretField' )
204252 } )
205253
206254 it ( 'preserves zero years of candidate skill experience' , async ( ) => {
207- mocks . json . mockResolvedValueOnce ( page ( [ candidate ( ) ] ) ) . mockResolvedValueOnce ( page ( [ { SkillId : '1' , YearsOfExperience : 0 } ] ) )
255+ mocks . json
256+ . mockResolvedValueOnce ( page ( [ candidate ( ) ] ) )
257+ . mockResolvedValueOnce ( page ( [ { SkillId : '1' , YearsOfExperience : 0 } ] ) )
208258 const result = await operations . executeListCandidateSkills ( { ...auth , candidateNumber : '1' } )
209259 expect ( result . output . skills [ 0 ] . yearsOfExperience ) . toBe ( '0' )
210260 } )
211261 it ( 'preserves bounded pagination even when the estimated total is smaller' , async ( ) => {
212- mocks . json . mockResolvedValue ( page ( [ { CandidateNumber : '1' } ] , { hasMore : true , offset : 20 , totalResults : 0 } ) )
262+ mocks . json . mockResolvedValue (
263+ page ( [ { CandidateNumber : '1' } ] , { hasMore : true , offset : 20 , totalResults : 0 } )
264+ )
213265 const result = await operations . executeListCandidates ( { ...auth , offset : 20 } )
214- expect ( result . output ) . toMatchObject ( { count : 1 , nextOffset : 21 , hasMore : true , totalResults : 0 } )
266+ expect ( result . output ) . toMatchObject ( {
267+ count : 1 ,
268+ nextOffset : 21 ,
269+ hasMore : true ,
270+ totalResults : 0 ,
271+ } )
215272 expect ( mocks . json ) . toHaveBeenCalledOnce ( )
216273 } )
217274 it ( 'rejects oversized pages instead of returning unbounded results' , async ( ) => {
218275 mocks . json . mockResolvedValue ( page ( [ { CandidateNumber : '1' } , { CandidateNumber : '2' } ] ) )
219- await expect ( operations . executeListCandidates ( { ...auth , limit : 1 } ) ) . rejects . toMatchObject ( { status : 502 } )
276+ await expect ( operations . executeListCandidates ( { ...auth , limit : 1 } ) ) . rejects . toMatchObject ( {
277+ status : 502 ,
278+ } )
220279 } )
221280 it ( 'accepts an empty terminal page' , async ( ) => {
222281 mocks . json . mockResolvedValue ( page ( [ ] ) )
@@ -226,10 +285,14 @@ describe('Recruiting provider operations', () => {
226285 page ( [ ] ) ,
227286 page ( [ candidate ( ) , candidate ( ) ] ) ,
228287 page ( [ item ( 'recruitingCandidates' , { CandidateNumber : '2' } ) ] ) ,
229- page ( [ { CandidateNumber : '1' , links : [ { rel : 'self' , href : 'https://other.example/candidate' } ] } ] ) ,
288+ page ( [
289+ { CandidateNumber : '1' , links : [ { rel : 'self' , href : 'https://other.example/candidate' } ] } ,
290+ ] ) ,
230291 ] ) ( 'rejects missing, ambiguous, mismatched, or foreign candidate lookups' , async ( raw ) => {
231292 mocks . json . mockResolvedValue ( raw )
232- await expect ( operations . executeDeleteCandidate ( { ...auth , candidateNumber : '1' } ) ) . rejects . toBeInstanceOf ( OracleFusionProviderError )
293+ await expect (
294+ operations . executeDeleteCandidate ( { ...auth , candidateNumber : '1' } )
295+ ) . rejects . toBeInstanceOf ( OracleFusionProviderError )
233296 expect ( mocks . empty ) . not . toHaveBeenCalled ( )
234297 } )
235298 it ( 'gets a candidate using its validated opaque link' , async ( ) => {
@@ -239,45 +302,88 @@ describe('Recruiting provider operations', () => {
239302 expect ( mocks . json . mock . calls [ 1 ] [ 1 ] . address . relativePath ) . toBe ( 'recruitingCandidates/opaque-key' )
240303 } )
241304 it ( 'finds an offer by exact primary key without treating its ID as a path key' , async ( ) => {
242- mocks . json . mockResolvedValue ( page ( [ item ( 'recruitingJobOffers' , { OfferId : '9007199254740993' } ) ] ) )
305+ mocks . json . mockResolvedValue (
306+ page ( [ item ( 'recruitingJobOffers' , { OfferId : '9007199254740993' } ) ] )
307+ )
243308 const result = await operations . executeGetOffer ( { ...auth , offerId : '9007199254740993' } )
244309 expect ( result . output . offer . offerId ) . toBe ( '9007199254740993' )
245310 expect ( mocks . json . mock . calls [ 0 ] [ 1 ] . query . finder ) . toBe ( 'PrimaryKey;OfferId=9007199254740993' )
246311 expect ( mocks . json ) . toHaveBeenCalledOnce ( )
247312 } )
248313 it ( 'preserves null and omits undefined candidate updates' , async ( ) => {
249314 mocks . json . mockResolvedValueOnce ( page ( [ candidate ( ) ] ) ) . mockResolvedValueOnce ( candidate ( ) )
250- await operations . executeUpdateCandidate ( { ...auth , candidateNumber : '1' , body : { FirstName : 'Taylor' , Email : null , LastName : undefined } } )
251- expect ( mocks . json . mock . calls [ 1 ] [ 1 ] ) . toMatchObject ( { method : 'PATCH' , body : { FirstName : 'Taylor' , Email : null } } )
315+ await operations . executeUpdateCandidate ( {
316+ ...auth ,
317+ candidateNumber : '1' ,
318+ body : { FirstName : 'Taylor' , Email : null , LastName : undefined } ,
319+ } )
320+ expect ( mocks . json . mock . calls [ 1 ] [ 1 ] ) . toMatchObject ( {
321+ method : 'PATCH' ,
322+ body : { FirstName : 'Taylor' , Email : null } ,
323+ } )
252324 expect ( mocks . json . mock . calls [ 1 ] [ 1 ] . body ) . not . toHaveProperty ( 'LastName' )
253325 } )
254326 it ( 'serializes requisition IDs as exact numeric JSON tokens' , async ( ) => {
255327 mocks . json . mockResolvedValue ( requisition ( ) )
256- await operations . executeCreateRequisition ( { ...auth , body : { "Title" : "Engineer" , "RecruitingType" : "ORA_PROFESSIONAL" , "HiringManagerId" : "9007199254740993" , "RecruiterId" : "2" , "PrimaryLocationId" : "3" , "PhaseId" : "1" , "StateId" : "21" , "UnlimitedOpenings" : "N" , "NumberOfOpenings" : 1 } } )
328+ await operations . executeCreateRequisition ( {
329+ ...auth ,
330+ body : {
331+ Title : 'Engineer' ,
332+ RecruitingType : 'ORA_PROFESSIONAL' ,
333+ HiringManagerId : '9007199254740993' ,
334+ RecruiterId : '2' ,
335+ PrimaryLocationId : '3' ,
336+ PhaseId : '1' ,
337+ StateId : '21' ,
338+ UnlimitedOpenings : 'N' ,
339+ NumberOfOpenings : 1 ,
340+ } ,
341+ } )
257342 const body = mocks . json . mock . calls [ 0 ] [ 1 ] . body
258343 expect ( serializeOracleFusionJsonBody ( body ) ) . toContain ( '"HiringManagerId":9007199254740993' )
259344 expect ( mocks . json ) . toHaveBeenCalledOnce ( )
260345 } )
261346 it ( 'deletes a phone only under the resolved candidate and phone keys' , async ( ) => {
262- mocks . json . mockResolvedValueOnce ( page ( [ candidate ( ) ] ) ) . mockResolvedValueOnce ( page ( [
263- item ( 'recruitingCandidates/opaque-key/child/candidatePhones' , { PhoneId : '2' } ) ,
264- ] ) )
347+ mocks . json
348+ . mockResolvedValueOnce ( page ( [ candidate ( ) ] ) )
349+ . mockResolvedValueOnce (
350+ page ( [ item ( 'recruitingCandidates/opaque-key/child/candidatePhones' , { PhoneId : '2' } ) ] )
351+ )
265352 mocks . empty . mockResolvedValue ( undefined )
266- const result = await operations . executeDeleteCandidatePhone ( { ...auth , candidateNumber : '1' , phoneId : '2' } )
353+ const result = await operations . executeDeleteCandidatePhone ( {
354+ ...auth ,
355+ candidateNumber : '1' ,
356+ phoneId : '2' ,
357+ } )
267358 expect ( result . output ) . toEqual ( { deleted : true } )
268- expect ( mocks . empty ) . toHaveBeenCalledWith ( expect . anything ( ) , {
269- address : { family : 'hcm' , relativePath : 'recruitingCandidates/opaque-key/child/candidatePhones/opaque-key' } , method : 'DELETE' ,
270- } , undefined )
359+ expect ( mocks . empty ) . toHaveBeenCalledWith (
360+ expect . anything ( ) ,
361+ {
362+ address : {
363+ family : 'hcm' ,
364+ relativePath : 'recruitingCandidates/opaque-key/child/candidatePhones/opaque-key' ,
365+ } ,
366+ method : 'DELETE' ,
367+ } ,
368+ undefined
369+ )
271370 } )
272371 it ( 'does not repeat failed writes' , async ( ) => {
273372 mocks . json . mockRejectedValue ( new OracleFusionProviderError ( 'Rate limited' , 429 ) )
274- await expect ( operations . executeCreateCandidate ( { ...auth , body : { FirstName : 'Taylor' } } ) ) . rejects . toMatchObject ( { status : 429 } )
373+ await expect (
374+ operations . executeCreateCandidate ( { ...auth , body : { FirstName : 'Taylor' } } )
375+ ) . rejects . toMatchObject ( { status : 429 } )
275376 expect ( mocks . json ) . toHaveBeenCalledOnce ( )
276377 } )
277378 it ( 'forwards cancellation and stops before a second request' , async ( ) => {
278379 const controller = new AbortController ( )
279- mocks . json . mockImplementation ( async ( ) => { controller . abort ( ) ; return page ( [ candidate ( ) ] ) } )
280- await expect ( operations . executeGetCandidate ( { ...auth , candidateNumber : '1' } , controller . signal ) ) . rejects . toThrow ( )
380+ mocks . json . mockImplementation ( async ( ) => {
381+ controller . abort ( )
382+ return page ( [ candidate ( ) ] )
383+ } )
384+ await expect (
385+ operations . executeGetCandidate ( { ...auth , candidateNumber : '1' } , controller . signal )
386+ ) . rejects . toThrow ( )
281387 expect ( mocks . json ) . toHaveBeenCalledOnce ( )
282388 expect ( mocks . json . mock . calls [ 0 ] [ 2 ] ) . toBe ( controller . signal )
283389 } )
@@ -352,7 +458,7 @@ describe('Recruiting provider operations', () => {
352458 } )
353459 expect ( result . output . candidate . candidateNumber ) . toBe ( '1' )
354460 expect ( mocks . json ) . toHaveBeenCalledExactlyOnceWith (
355- auth ,
461+ expect . objectContaining ( auth ) ,
356462 {
357463 address : { family : 'hcm' , relativePath : 'recruitingCandidates' } ,
358464 method : 'POST' ,
0 commit comments