Skip to content

Commit 831490d

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(quickbooks): clean up consolidated CI
1 parent 161c8a7 commit 831490d

5 files changed

Lines changed: 22 additions & 17 deletions

File tree

apps/docs/content/docs/en/integrations/zoho_desk.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Manage Zoho Desk tickets, comments, threads, and contacts
55

66
import { BlockInfoCard } from "@/components/ui/block-info-card"
77

8-
<BlockInfoCard
8+
<BlockInfoCard
99
type="zoho_desk"
1010
color="#FFFFFF"
1111
/>
@@ -512,3 +512,4 @@ Trigger a workflow when a Zoho Desk event occurs (ticket, comment, thread, conta
512512
| `orgId` | string | Zoho Desk organization ID |
513513
| `payload` | json | The full resource that changed \(ticket, comment, thread, etc.\). Comment and thread events gain a derived plain-text `contentText` alongside the raw `content` + `contentType`; ticket events gain `descriptionText` alongside `description`. |
514514
| `prevState` | json | Previous state of the resource \(update events only\) |
515+

apps/sim/app/api/tools/quickbooks/documents.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import {
66
hybridAuthMockFns,
77
inputValidationMock,
88
inputValidationMockFns,
9+
resetEnvMock,
10+
setEnv,
911
} from '@sim/testing'
1012
import { NextRequest } from 'next/server'
11-
import { beforeEach, describe, expect, it, vi } from 'vitest'
13+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
1214
import { MAX_FILE_SIZE } from '@/lib/uploads/utils/validation'
1315

1416
const {
@@ -64,6 +66,7 @@ function createAbortableRequest(body: unknown, signal: AbortSignal): NextRequest
6466
}
6567

6668
beforeEach(() => {
69+
setEnv({ QUICKBOOKS_ENV: 'sandbox' })
6770
vi.clearAllMocks()
6871
vi.stubGlobal('fetch', mockFetch)
6972
hybridAuthMockFns.mockCheckInternalAuth.mockResolvedValue({
@@ -100,6 +103,8 @@ beforeEach(() => {
100103
})
101104
})
102105

106+
afterEach(resetEnvMock)
107+
103108
describe('QuickBooks document API routes', () => {
104109
it('authenticates before parsing a PDF request', async () => {
105110
hybridAuthMockFns.mockCheckInternalAuth.mockResolvedValueOnce({

apps/sim/lib/workflows/blocks/block-outputs.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function isConditionPrimitive(value: unknown): value is ConditionValue {
5252
* Evaluates an output condition against subBlock values.
5353
* Returns true if the condition is met and the output should be shown.
5454
*/
55-
export function evaluateOutputCondition(
55+
function evaluateOutputCondition(
5656
condition: OutputCondition,
5757
subBlocks: Record<string, SubBlockWithValue> | undefined
5858
): boolean {
@@ -93,10 +93,6 @@ export function evaluateOutputCondition(
9393
matches = matches && andMatches
9494
}
9595

96-
if (condition.or) {
97-
matches = matches || evaluateOutputCondition(condition.or, subBlocks)
98-
}
99-
10096
return matches
10197
}
10298

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { readFileSync } from 'node:fs'
22
import { resetEnvMock, setEnv } from '@sim/testing'
3-
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
4-
import { evaluateOutputCondition } from '@/lib/workflows/blocks/block-outputs'
3+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
4+
import { getBlockOutputs } from '@/lib/workflows/blocks/block-outputs'
55
import { evaluateSubBlockCondition } from '@/lib/workflows/subblocks/visibility'
66
import { QuickBooksBlock } from '@/blocks/blocks/quickbooks'
7+
import { getBlock } from '@/blocks/registry'
78
import {
89
quickbooksAddAttachmentTool,
910
quickbooksCreateBillPaymentTool,
@@ -1224,25 +1225,28 @@ describe('QuickBooks tool and block boundaries', () => {
12241225
],
12251226
and: { field: 'readMode', value: 'list' },
12261227
})
1227-
const listOutputCondition = QuickBooksBlock.outputs.items.condition!
1228+
vi.mocked(getBlock)
1229+
.mockReturnValueOnce(QuickBooksBlock)
1230+
.mockReturnValueOnce(QuickBooksBlock)
1231+
.mockReturnValueOnce(QuickBooksBlock)
12281232
expect(
1229-
evaluateOutputCondition(listOutputCondition, {
1233+
getBlockOutputs('quickbooks', {
12301234
operation: { value: 'quickbooks_read_sales_transactions' },
12311235
readMode: { value: 'by_id' },
12321236
})
1233-
).toBe(false)
1237+
).not.toHaveProperty('items')
12341238
expect(
1235-
evaluateOutputCondition(listOutputCondition, {
1239+
getBlockOutputs('quickbooks', {
12361240
operation: { value: 'quickbooks_read_sales_transactions' },
12371241
readMode: { value: 'list' },
12381242
})
1239-
).toBe(true)
1243+
).toHaveProperty('items')
12401244
expect(
1241-
evaluateOutputCondition(listOutputCondition, {
1245+
getBlockOutputs('quickbooks', {
12421246
operation: { value: 'quickbooks_read_purchasing_transactions' },
12431247
readMode: { value: 'list' },
12441248
})
1245-
).toBe(true)
1249+
).toHaveProperty('items')
12461250
expect(subBlocks.syncToken.condition).toEqual({
12471251
field: 'operation',
12481252
value: [

packages/workflow-types/src/blocks.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export interface OutputCondition {
7171
| null
7272
not?: boolean
7373
}
74-
or?: OutputCondition
7574
}
7675

7776
export type OutputFieldDefinition =

0 commit comments

Comments
 (0)