Skip to content

Commit 625dd6e

Browse files
test(trigger): mock resolveTriggerRegion in delete-async route test
The route now pulls in feature-flags (which imports isAppConfigEnabled from env-flags); the test's partial env-flags mock made that access throw. Stub the region module and assert the region option on the dispatch.
1 parent b48c4c3 commit 625dd6e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/sim/app/api/table/[tableId]/delete-async/route.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ vi.mock('@/lib/core/config/env-flags', () => ({
3939
},
4040
}))
4141
vi.mock('@/background/table-delete', () => ({ tableDeleteTask: { id: 'table-delete' } }))
42+
vi.mock('@/lib/core/async-jobs/region', () => ({
43+
resolveTriggerRegion: vi.fn().mockResolvedValue('us-east-1'),
44+
}))
4245
vi.mock('@trigger.dev/sdk', () => ({
4346
tasks: { trigger: mockTasksTrigger },
4447
task: (config: unknown) => config,
@@ -196,7 +199,7 @@ describe('POST /api/table/[tableId]/delete-async', () => {
196199
excludeRowIds: ['row_keep'],
197200
cutoff: expect.any(String),
198201
}),
199-
{ tags: ['tableId:tbl_1', 'jobId:job-id-xyz'] }
202+
{ tags: ['tableId:tbl_1', 'jobId:job-id-xyz'], region: 'us-east-1' }
200203
)
201204
})
202205

0 commit comments

Comments
 (0)