Skip to content

Commit 4f2eea3

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
test(quickbooks): cover null report filters
1 parent af25edf commit 4f2eea3

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

apps/sim/tools/quickbooks/reports.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,29 @@ describe('QuickBooks report block behavior', () => {
385385
})
386386
})
387387

388+
it('omits blank report filters serialized as null by the editor', () => {
389+
const params = QuickBooksBlock.tools.config!.params!({
390+
operation: 'quickbooks_run_financial_report',
391+
oauthCredential: 'credential-id',
392+
reportType: 'ap_aging_summary',
393+
reportEndDate: '2026-08-02',
394+
reportVendorId: null,
395+
reportDepartmentId: null,
396+
reportAgingMethod: 'report_date',
397+
reportAgingDays: '30',
398+
})
399+
400+
expect(params.vendorId).toBeUndefined()
401+
expect(params.departmentId).toBeUndefined()
402+
403+
const url = buildQuickBooksReportUrl({
404+
...authParams,
405+
...params,
406+
} as QuickBooksRunFinancialReportParams)
407+
expect(url.searchParams.has('vendor')).toBe(false)
408+
expect(url.searchParams.has('department')).toBe(false)
409+
})
410+
388411
it('keeps support arrays consistent with the block conditions', () => {
389412
expect(getQuickBooksReportTypesSupporting('aging')).toEqual([
390413
'ap_aging_detail',

0 commit comments

Comments
 (0)