Skip to content

Commit ce98e04

Browse files
committed
fix(desktop): pass route context in the workspaces forwarding test
1 parent e0d84d7 commit ce98e04

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎apps/sim/app/api/workspaces/route.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ describe('GET /api/workspaces blocked viewer forwarding', () => {
112112
pinnedWorkspaceIds: [],
113113
creationPolicy: { canCreate: false },
114114
}
115+
const routeContext = { params: Promise.resolve({}) }
115116
const listRequest = () =>
116117
createMockRequest('GET', undefined, {}, 'http://localhost/api/workspaces')
117118

@@ -126,19 +127,19 @@ describe('GET /api/workspaces blocked viewer forwarding', () => {
126127

127128
it('names the organization that can serve a viewer with nothing to pick', async () => {
128129
mockResolveRolledOutOrganizationId.mockResolvedValue('org-1')
129-
const response = await GET(listRequest())
130+
const response = await GET(listRequest(), routeContext)
130131
expect((await response.json()).forwardOrganizationId).toBe('org-1')
131132
})
132133

133134
it('leaves the blocked picker in place when no organization can serve them', async () => {
134135
mockResolveRolledOutOrganizationId.mockResolvedValue(null)
135-
const response = await GET(listRequest())
136+
const response = await GET(listRequest(), routeContext)
136137
expect(await response.json()).not.toHaveProperty('forwardOrganizationId')
137138
})
138139

139140
it('still returns the list when the organization lookup fails', async () => {
140141
mockResolveRolledOutOrganizationId.mockRejectedValue(new Error('down'))
141-
const response = await GET(listRequest())
142+
const response = await GET(listRequest(), routeContext)
142143
expect(response.status).toBe(200)
143144
expect(await response.json()).not.toHaveProperty('forwardOrganizationId')
144145
})

0 commit comments

Comments
 (0)