@@ -156,31 +156,79 @@ describe('Learning operation dispatch', () => {
156156 ] ,
157157 [ 'list_enrollment_history' , 'executeListEnrollmentHistory' , { personId : '1' , recordId : '1' } ] ,
158158 [ 'list_assignment_profiles' , 'executeListAssignmentProfiles' , { } ] ,
159- [ 'get_assignment_profile' , 'executeGetAssignmentProfile' , { "profileId" :"1" } ] ,
160- [ 'create_assignment_profile' , 'executeCreateAssignmentProfile' , { "body" :{ "assignmentProfileStatus" :"TEST_STATUS" , "assignmentType" :"ORA_REQUIRE_ASSIGNMENT" , "learningItemId" :"3" } } ] ,
161- [ 'update_assignment_profile' , 'executeUpdateAssignmentProfile' , { "profileId" :"1" , "body" :{ "completionComments" :null } } ] ,
162- [ 'process_assignment_profile' , 'executeProcessAssignmentProfile' , { "profileId" :"1" } ] ,
163- [ 'list_assignment_profile_records' , 'executeListAssignmentProfileRecords' , { "profileId" :"1" } ] ,
164- [ 'list_assignment_profile_criteria' , 'executeListAssignmentProfileCriteria' , { "profileId" :"1" } ] ,
165- [ 'add_assignment_profile_criterion' , 'executeAddAssignmentProfileCriterion' , { "profileId" :"1" , "body" :{ "assignmentProfileCriteriaTypeId" :"5" } } ] ,
166- [ 'remove_assignment_profile_criterion' , 'executeRemoveAssignmentProfileCriterion' , { "profileId" :"1" , "criterionId" :"1" } ] ,
167- [ 'list_learning_item_audiences' , 'executeListLearningItemAudiences' , { "learningItemId" :"1" } ] ,
168- [ 'add_learning_item_audience' , 'executeAddLearningItemAudience' , { "learningItemId" :"1" , "body" :{ "sourceType" :"ORA_PERSON" , "sourceTypeId" :"6" , "learningItemType" :"TEST_TYPE" } } ] ,
169- [ 'remove_learning_item_audience' , 'executeRemoveLearningItemAudience' , { "learningItemId" :"1" , "audienceId" :"1" } ] ,
170- [ 'get_content_item' , 'executeGetContentItem' , { "contentId" :"1" } ] ,
171- [ 'create_web_link_content' , 'executeCreateWebLinkContent' , { "body" :{ "Title" :"Web course" , "URL" :"https://example.com" } } ] ,
172- [ 'update_content_item' , 'executeUpdateContentItem' , { "contentId" :"1" , "body" :{ "Description" :null } } ] ,
159+ [ 'get_assignment_profile' , 'executeGetAssignmentProfile' , { profileId : '1' } ] ,
160+ [
161+ 'create_assignment_profile' ,
162+ 'executeCreateAssignmentProfile' ,
163+ {
164+ body : {
165+ assignmentProfileStatus : 'TEST_STATUS' ,
166+ assignmentType : 'ORA_REQUIRE_ASSIGNMENT' ,
167+ learningItemId : '3' ,
168+ } ,
169+ } ,
170+ ] ,
171+ [
172+ 'update_assignment_profile' ,
173+ 'executeUpdateAssignmentProfile' ,
174+ { profileId : '1' , body : { completionComments : null } } ,
175+ ] ,
176+ [ 'process_assignment_profile' , 'executeProcessAssignmentProfile' , { profileId : '1' } ] ,
177+ [ 'list_assignment_profile_records' , 'executeListAssignmentProfileRecords' , { profileId : '1' } ] ,
178+ [ 'list_assignment_profile_criteria' , 'executeListAssignmentProfileCriteria' , { profileId : '1' } ] ,
179+ [
180+ 'add_assignment_profile_criterion' ,
181+ 'executeAddAssignmentProfileCriterion' ,
182+ { profileId : '1' , body : { assignmentProfileCriteriaTypeId : '5' } } ,
183+ ] ,
184+ [
185+ 'remove_assignment_profile_criterion' ,
186+ 'executeRemoveAssignmentProfileCriterion' ,
187+ { profileId : '1' , criterionId : '1' } ,
188+ ] ,
189+ [ 'list_learning_item_audiences' , 'executeListLearningItemAudiences' , { learningItemId : '1' } ] ,
190+ [
191+ 'add_learning_item_audience' ,
192+ 'executeAddLearningItemAudience' ,
193+ {
194+ learningItemId : '1' ,
195+ body : { sourceType : 'ORA_PERSON' , sourceTypeId : '6' , learningItemType : 'TEST_TYPE' } ,
196+ } ,
197+ ] ,
198+ [
199+ 'remove_learning_item_audience' ,
200+ 'executeRemoveLearningItemAudience' ,
201+ { learningItemId : '1' , audienceId : '1' } ,
202+ ] ,
203+ [ 'get_content_item' , 'executeGetContentItem' , { contentId : '1' } ] ,
204+ [
205+ 'create_web_link_content' ,
206+ 'executeCreateWebLinkContent' ,
207+ { body : { Title : 'Web course' , URL : 'https://example.com' } } ,
208+ ] ,
209+ [ 'update_content_item' , 'executeUpdateContentItem' , { contentId : '1' , body : { Description : null } } ] ,
173210 ] as const ) ( 'dispatches %s through its product schema' , async ( operation , handler , input ) => {
174211 const signal = new AbortController ( ) . signal
175- const response = await invoke ( { toolId : `oracle_fusion_learning_${ operation } ` , input : { ...auth , ...input } , signal } )
212+ const response = await invoke ( {
213+ toolId : `oracle_fusion_learning_${ operation } ` ,
214+ input : { ...auth , ...input } ,
215+ signal,
216+ } )
176217 expect ( response . status ) . toBe ( 200 )
177218 expect ( mocks [ handler ] ) . toHaveBeenCalledWith ( { ...auth , ...input } , signal )
178219 } )
179220
180221 it ( 'rejects unsupported fields before calling the mutation operation' , async ( ) => {
181- const response = await invoke ( { toolId : 'oracle_fusion_learning_update_completion_detail' , input : {
182- ...auth , personId : '1' , recordId : '2' , completionDetailId : '3' , body : { completedDate : '2026-09-05' } ,
183- } } )
222+ const response = await invoke ( {
223+ toolId : 'oracle_fusion_learning_update_completion_detail' ,
224+ input : {
225+ ...auth ,
226+ personId : '1' ,
227+ recordId : '2' ,
228+ completionDetailId : '3' ,
229+ body : { completedDate : '2026-09-05' } ,
230+ } ,
231+ } )
184232 expect ( response . status ) . toBe ( 400 )
185233 expect ( mocks . executeUpdateCompletionDetail ) . not . toHaveBeenCalled ( )
186234 } )
@@ -200,7 +248,9 @@ describe('Learning operation dispatch', () => {
200248 } )
201249 expect ( response . status ) . toBe ( 500 )
202250 expect ( await response . json ( ) ) . toEqual ( {
203- success : false , error : 'Oracle Fusion Learning request failed' , retryable : false ,
251+ success : false ,
252+ error : 'Oracle Fusion Learning request failed' ,
253+ retryable : false ,
204254 } )
205255 expect ( mocks . executeCreateWebLinkContent ) . toHaveBeenCalledTimes ( 1 )
206256 } )
@@ -209,6 +259,9 @@ describe('Learning operation dispatch', () => {
209259 mocks . executeListSelfPacedItems . mockRejectedValue ( new Error ( 'private-provider-data' ) )
210260 const response = await invoke ( )
211261 expect ( response . status ) . toBe ( 500 )
212- expect ( await response . json ( ) ) . toEqual ( { success : false , error : 'Oracle Fusion Learning request failed' } )
262+ expect ( await response . json ( ) ) . toEqual ( {
263+ success : false ,
264+ error : 'Oracle Fusion Learning request failed' ,
265+ } )
213266 } )
214267} )
0 commit comments