Skip to content

Commit 68cbb1d

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(quickbooks): keep shared line example valid
1 parent 702149c commit 68cbb1d

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

apps/sim/blocks/blocks/quickbooks.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,7 @@ export const QuickBooksBlock: BlockConfig<QuickBooksResponse> = {
742742
title: 'Expense Lines (JSON)',
743743
type: 'code',
744744
language: 'json',
745-
placeholder:
746-
'[{"lineType":"account","amount":100,"accountId":"7","description":"Supplies","purchaseOrderId":"123","purchaseOrderLineId":"1"}]',
745+
placeholder: '[{"lineType":"account","amount":100,"accountId":"7","description":"Supplies"}]',
747746
condition: {
748747
field: 'operation',
749748
value: [

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,16 @@ describe('QuickBooks purchasing mutation bodies', () => {
672672
})
673673

674674
describe('QuickBooks purchasing block', () => {
675+
it('keeps the shared purchasing-lines example valid for every supported operation', () => {
676+
const subBlock = QuickBooksBlock.subBlocks.find(
677+
(candidate) => candidate.id === 'purchasingLines'
678+
)
679+
680+
expect(subBlock?.placeholder).not.toContain('purchaseOrderId')
681+
expect(subBlock?.placeholder).not.toContain('purchaseOrderLineId')
682+
expect(subBlock?.wandConfig?.prompt).toContain('For Create Bill only')
683+
})
684+
675685
it('does not force array-valued wand prompts through JSON-object generation', () => {
676686
for (const id of ['purchasingLines', 'billAllocations']) {
677687
const subBlock = QuickBooksBlock.subBlocks.find((candidate) => candidate.id === id)

0 commit comments

Comments
 (0)