Skip to content

Commit 522cc62

Browse files
committed
fix(tables): use getErrorMessage in the columns route test mock
`check:utils` bans the inline `e instanceof Error ? e.message : fallback` form; the mock for `rootErrorMessage` used it.
1 parent d515dcd commit 522cc62

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/sim/app/api/table/[tableId]/columns/route.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* caller cannot see or undo. These pin the pre-flight guards ahead of it.
88
*/
99
import { hybridAuthMockFns } from '@sim/testing'
10+
import { getErrorMessage } from '@sim/utils/errors'
1011
import { NextRequest } from 'next/server'
1112
import { beforeEach, describe, expect, it, vi } from 'vitest'
1213

@@ -43,7 +44,7 @@ vi.mock('@/app/api/table/utils', () => ({
4344
accessError: () => new Response('denied', { status: 403 }),
4445
checkAccess: mockCheckAccess,
4546
normalizeColumn: (c: unknown) => c,
46-
rootErrorMessage: (e: unknown) => (e instanceof Error ? e.message : String(e)),
47+
rootErrorMessage: (e: unknown) => getErrorMessage(e),
4748
tableLockErrorResponse: () => null,
4849
}))
4950

0 commit comments

Comments
 (0)