Skip to content

Commit ecee883

Browse files
author
test
committed
test(workflows): fix AuthType mock shape in async route test
1 parent cd24443 commit ecee883

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

apps/sim/app/api/workflows/[id]/execute/route.async.test.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { createMockRequest } from '@sim/testing'
66
import { beforeEach, describe, expect, it, vi } from 'vitest'
77

88
const {
9+
mockAuthType,
910
mockCheckHybridAuth,
1011
mockAuthorizeWorkflowByWorkspacePermission,
1112
mockPreprocessExecution,
@@ -17,6 +18,11 @@ const {
1718
mockLoggerError,
1819
mockLoggerDebug,
1920
} = vi.hoisted(() => ({
21+
mockAuthType: {
22+
SESSION: 'session',
23+
API_KEY: 'api_key',
24+
INTERNAL_JWT: 'internal_jwt',
25+
},
2026
mockCheckHybridAuth: vi.fn(),
2127
mockAuthorizeWorkflowByWorkspacePermission: vi.fn(),
2228
mockPreprocessExecution: vi.fn(),
@@ -30,11 +36,7 @@ const {
3036
}))
3137

3238
vi.mock('@/lib/auth/hybrid', () => ({
33-
AuthType: {
34-
SESSION: 'session',
35-
API_KEY: 'api_key',
36-
INTERNAL_JWT: 'internal_jwt',
37-
},
39+
AuthType: mockAuthType,
3840
checkHybridAuth: mockCheckHybridAuth,
3941
}))
4042

@@ -137,7 +139,7 @@ describe('workflow execute async route', () => {
137139
return {
138140
success: true,
139141
userId: 'session-user-1',
140-
authType: 'session',
142+
authType: mockAuthType.SESSION,
141143
}
142144
})
143145

0 commit comments

Comments
 (0)