Skip to content

Commit 026b683

Browse files
committed
fix(integrations): validate ashby
1 parent 0be28a0 commit 026b683

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎apps/sim/tools/ashby/ashby.test.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { changeApplicationStageTool } from '@/tools/ashby/change_application_sta
66
import { deleteApplicationTool } from '@/tools/ashby/delete_application'
77
import { getApplicationTool } from '@/tools/ashby/get_application'
88
import { getCandidateTool } from '@/tools/ashby/get_candidate'
9+
import { getJobTool } from '@/tools/ashby/get_job'
910
import { getJobPostingTool } from '@/tools/ashby/get_job_posting'
1011
import { listApplicationsTool } from '@/tools/ashby/list_applications'
1112
import { listCandidatesTool } from '@/tools/ashby/list_candidates'
@@ -263,6 +264,18 @@ describe('ashby request bodies', () => {
263264
expect(body).not.toHaveProperty('includeUnpublishedJobPostingsIds')
264265
})
265266

267+
it('get_job sends the job.info spelling of the unpublished posting IDs flag', () => {
268+
// job.info rejects unknown keys (additionalProperties: false), so the
269+
// singular `includeUnpublishedJobPostingIds` never reached Ashby as intended.
270+
const body = requestBody(getJobTool, {
271+
apiKey: 'k',
272+
jobId: ' j ',
273+
includeUnpublishedJobPostingIds: true,
274+
})
275+
expect(body).toMatchObject({ id: 'j', includeUnpublishedJobPostingsIds: true })
276+
expect(body).not.toHaveProperty('includeUnpublishedJobPostingIds')
277+
})
278+
266279
it('change_application_source sends sourceId when one is provided', () => {
267280
// Ashby requires the key to be present; omitting it is a 400 rather than
268281
// the intended write.

‎apps/sim/tools/ashby/get_job.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const getJobTool: ToolConfig<AshbyGetJobParams, AshbyGetJobResponse> = {
3939
id: params.jobId.trim(),
4040
expand: ['openings', 'location', 'compensation'],
4141
...(params.includeUnpublishedJobPostingIds !== undefined
42-
? { includeUnpublishedJobPostingIds: params.includeUnpublishedJobPostingIds }
42+
? { includeUnpublishedJobPostingsIds: params.includeUnpublishedJobPostingIds }
4343
: {}),
4444
}),
4545
},

0 commit comments

Comments
 (0)