@@ -63,7 +63,7 @@ describe.each(modes)('Orchestrator Jobs - Integration Tests [%s]', (mode) => {
6363 } ) ;
6464
6565 describe ( 'getById' , ( ) => {
66- it ( 'should retrieve a job by key ' , async ( ) => {
66+ it ( 'should retrieve a fully transformed job with bound methods ' , async ( ) => {
6767 const { jobs, folderId } = getJobsService ( ) ;
6868
6969 if ( ! folderId ) {
@@ -77,17 +77,33 @@ describe.each(modes)('Orchestrator Jobs - Integration Tests [%s]', (mode) => {
7777 } ) ;
7878
7979 if ( allJobs . items . length === 0 ) {
80- throw new Error ( 'No jobs available to test getById.' ) ;
80+ console . warn ( 'No jobs available to test getById — skipping.' ) ;
81+ return ;
8182 }
8283
8384 const jobKey = allJobs . items [ 0 ] . key ;
8485 const job = await jobs . getById ( jobKey , folderId ) ;
8586
87+ // Core fields
8688 expect ( job ) . toBeDefined ( ) ;
8789 expect ( job . id ) . toBeDefined ( ) ;
8890 expect ( job . key ) . toBe ( jobKey ) ;
8991 expect ( job . state ) . toBeDefined ( ) ;
9092 expect ( typeof job . id ) . toBe ( 'number' ) ;
93+
94+ // Bound methods
95+ expect ( job . getOutput ) . toBeDefined ( ) ;
96+ expect ( typeof job . getOutput ) . toBe ( 'function' ) ;
97+
98+ // Verify transformed camelCase fields exist
99+ expect ( job . createdTime ) . toBeDefined ( ) ;
100+ expect ( job . processName ) . toBeDefined ( ) ;
101+ expect ( job . folderId ) . toBeDefined ( ) ;
102+
103+ // Verify original PascalCase API fields are absent
104+ expect ( ( job as any ) . CreationTime ) . toBeUndefined ( ) ;
105+ expect ( ( job as any ) . ReleaseName ) . toBeUndefined ( ) ;
106+ expect ( ( job as any ) . OrganizationUnitId ) . toBeUndefined ( ) ;
91107 } ) ;
92108
93109 it ( 'should retrieve a job with expand options' , async ( ) => {
@@ -103,7 +119,8 @@ describe.each(modes)('Orchestrator Jobs - Integration Tests [%s]', (mode) => {
103119 } ) ;
104120
105121 if ( allJobs . items . length === 0 ) {
106- throw new Error ( 'No jobs available to test getById with expand.' ) ;
122+ console . warn ( 'No jobs available to test getById with expand — skipping.' ) ;
123+ return ;
107124 }
108125
109126 const jobKey = allJobs . items [ 0 ] . key ;
@@ -114,59 +131,6 @@ describe.each(modes)('Orchestrator Jobs - Integration Tests [%s]', (mode) => {
114131 expect ( job ) . toBeDefined ( ) ;
115132 expect ( job . key ) . toBe ( jobKey ) ;
116133 } ) ;
117-
118- it ( 'should have bound getOutput method on result' , async ( ) => {
119- const { jobs, folderId } = getJobsService ( ) ;
120-
121- if ( ! folderId ) {
122- throw new Error ( 'INTEGRATION_TEST_FOLDER_ID is required for getById tests.' ) ;
123- }
124-
125- const allJobs = await jobs . getAll ( {
126- folderId,
127- pageSize : 1 ,
128- } ) ;
129-
130- if ( allJobs . items . length === 0 ) {
131- throw new Error ( 'No jobs available to test getById bound methods.' ) ;
132- }
133-
134- const jobKey = allJobs . items [ 0 ] . key ;
135- const job = await jobs . getById ( jobKey , folderId ) ;
136-
137- expect ( job . getOutput ) . toBeDefined ( ) ;
138- expect ( typeof job . getOutput ) . toBe ( 'function' ) ;
139- } ) ;
140-
141- it ( 'should have transformed camelCase fields and no PascalCase fields' , async ( ) => {
142- const { jobs, folderId } = getJobsService ( ) ;
143-
144- if ( ! folderId ) {
145- throw new Error ( 'INTEGRATION_TEST_FOLDER_ID is required for getById transform tests.' ) ;
146- }
147-
148- const allJobs = await jobs . getAll ( {
149- folderId,
150- pageSize : 1 ,
151- } ) ;
152-
153- if ( allJobs . items . length === 0 ) {
154- throw new Error ( 'No jobs available to validate transform.' ) ;
155- }
156-
157- const jobKey = allJobs . items [ 0 ] . key ;
158- const job = await jobs . getById ( jobKey , folderId ) ;
159-
160- // Verify transformed camelCase fields exist
161- expect ( job . createdTime ) . toBeDefined ( ) ;
162- expect ( job . processName ) . toBeDefined ( ) ;
163- expect ( job . folderId ) . toBeDefined ( ) ;
164-
165- // Verify original PascalCase API fields are absent
166- expect ( ( job as any ) . CreationTime ) . toBeUndefined ( ) ;
167- expect ( ( job as any ) . ReleaseName ) . toBeUndefined ( ) ;
168- expect ( ( job as any ) . OrganizationUnitId ) . toBeUndefined ( ) ;
169- } ) ;
170134 } ) ;
171135
172136 describe ( 'getOutput' , ( ) => {
@@ -185,7 +149,8 @@ describe.each(modes)('Orchestrator Jobs - Integration Tests [%s]', (mode) => {
185149 } ) ;
186150
187151 if ( result . items . length === 0 ) {
188- throw new Error ( 'No successful jobs found to test getOutput.' ) ;
152+ console . warn ( 'No successful jobs found to test getOutput — skipping.' ) ;
153+ return ;
189154 }
190155
191156 const job = result . items [ 0 ] ;
@@ -208,7 +173,8 @@ describe.each(modes)('Orchestrator Jobs - Integration Tests [%s]', (mode) => {
208173 } ) ;
209174
210175 if ( result . items . length === 0 ) {
211- throw new Error ( 'No jobs available to validate structure' ) ;
176+ console . warn ( 'No jobs available to validate structure — skipping.' ) ;
177+ return ;
212178 }
213179
214180 const job = result . items [ 0 ] ;
0 commit comments