|
1 | 1 | import { describe, expect, it } from 'vitest' |
2 | 2 | import { WealthboxBlock } from '@/blocks/blocks/wealthbox' |
| 3 | +import { wealthboxReadContactTool } from '@/tools/wealthbox/read_contact' |
3 | 4 | import { wealthboxReadNoteTool } from '@/tools/wealthbox/read_note' |
| 5 | +import { wealthboxReadTaskTool } from '@/tools/wealthbox/read_task' |
4 | 6 | import { wealthboxWriteTaskTool } from '@/tools/wealthbox/write_task' |
5 | 7 |
|
6 | 8 | function mapParams(params: Record<string, unknown>, context?: { operation: string }) { |
@@ -67,3 +69,19 @@ describe('Wealthbox Read Note without a note ID', () => { |
67 | 69 | expect(result.output).toMatchObject({ notes, metadata: { totalItems: 1 } }) |
68 | 70 | }) |
69 | 71 | }) |
| 72 | + |
| 73 | +describe('Wealthbox canvas reads without an ID', () => { |
| 74 | + it('lists tasks when Read Task has no task ID', () => { |
| 75 | + const params = mapParams({ operation: 'read_task', oauthCredential: 'cred', taskId: '' }) |
| 76 | + const url = wealthboxReadTaskTool.request.url as (p: Record<string, unknown>) => string |
| 77 | + |
| 78 | + expect(url(params)).toBe('https://api.crmworkspace.com/v1/tasks') |
| 79 | + }) |
| 80 | + |
| 81 | + it('lists contacts when Read Contact has no contact ID', () => { |
| 82 | + const params = mapParams({ operation: 'read_contact', oauthCredential: 'cred', contactId: '' }) |
| 83 | + const url = wealthboxReadContactTool.request.url as (p: Record<string, unknown>) => string |
| 84 | + |
| 85 | + expect(url(params)).toBe('https://api.crmworkspace.com/v1/contacts') |
| 86 | + }) |
| 87 | +}) |
0 commit comments