Skip to content

Commit 5cfd216

Browse files
test(search): await async source integration selection
1 parent a4b603d commit 5cfd216

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

‎apps/sim/app/o/[organizationId]/settings/components/integrations/search-source-setup.test.tsx‎

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -604,17 +604,21 @@ describe('organization setup entry points', () => {
604604
connector({ id: 'new-gmail', connectorType: 'gmail', accessMode: 'admin' })
605605
)
606606
)
607-
expect(mocks.updateSearchIntegration).toHaveBeenCalledWith(
608-
{
609-
organizationId: 'org-1',
610-
connectorType: 'gmail',
611-
approved: true,
612-
policy: expect.objectContaining({
613-
accessMode: 'service_account',
614-
sourceId: 'new-gmail',
615-
}),
616-
},
617-
expect.any(Object)
607+
await vi.waitFor(
608+
() =>
609+
expect(mocks.updateSearchIntegration).toHaveBeenCalledWith(
610+
{
611+
organizationId: 'org-1',
612+
connectorType: 'gmail',
613+
approved: true,
614+
policy: expect.objectContaining({
615+
accessMode: 'service_account',
616+
sourceId: 'new-gmail',
617+
}),
618+
},
619+
expect.any(Object)
620+
),
621+
{ interval: 1 }
618622
)
619623
expect(mocks.push).not.toHaveBeenCalled()
620624
await act(async () => mocks.updateSearchIntegration.mock.calls[0][1].onSuccess())

0 commit comments

Comments
 (0)