Skip to content

Commit 61c49b7

Browse files
author
aadamgough
committed
added new test routes to fix build
1 parent 2f4995b commit 61c49b7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

apps/sim/app/api/auth/oauth/utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe('OAuth Utils', () => {
163163

164164
const result = await refreshTokenIfNeeded('request-id', mockCredential, 'credential-id')
165165

166-
expect(mockRefreshOAuthToken).toHaveBeenCalledWith('google', 'refresh-token')
166+
expect(mockRefreshOAuthToken).toHaveBeenCalledWith('google', 'refresh-token', undefined)
167167
expect(mockDb.update).toHaveBeenCalled()
168168
expect(mockDb.set).toHaveBeenCalled()
169169
expect(result).toEqual({ accessToken: 'new-token', refreshed: true })
@@ -251,7 +251,7 @@ describe('OAuth Utils', () => {
251251

252252
const token = await refreshAccessTokenIfNeeded('credential-id', 'test-user-id', 'request-id')
253253

254-
expect(mockRefreshOAuthToken).toHaveBeenCalledWith('google', 'refresh-token')
254+
expect(mockRefreshOAuthToken).toHaveBeenCalledWith('google', 'refresh-token', undefined)
255255
expect(mockDb.update).toHaveBeenCalled()
256256
expect(mockDb.set).toHaveBeenCalled()
257257
expect(token).toBe('new-token')

apps/sim/app/api/chat/[identifier]/route.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ describe('Chat Identifier API Route', () => {
106106

107107
vi.doMock('@/lib/workflows/streaming', () => ({
108108
createStreamingResponse: mockCreateStreamingResponse,
109+
}))
110+
111+
vi.doMock('@/lib/utils', () => ({
112+
generateRequestId: vi.fn().mockReturnValue('test-request-id'),
109113
SSE_HEADERS: {
110114
'Content-Type': 'text/event-stream',
111115
'Cache-Control': 'no-cache',
@@ -114,6 +118,10 @@ describe('Chat Identifier API Route', () => {
114118
},
115119
}))
116120

121+
vi.doMock('@/app/api/workflows/[id]/execute/route', () => ({
122+
createFilteredResult: vi.fn().mockReturnValue((result: any) => result),
123+
}))
124+
117125
vi.doMock('@/lib/logs/console/logger', () => ({
118126
createLogger: vi.fn().mockReturnValue({
119127
debug: vi.fn(),

0 commit comments

Comments
 (0)