Fix jest tests

This commit is contained in:
MartinBraquet
2026-05-24 16:35:15 +02:00
parent dd609e3448
commit bd2325126c
2 changed files with 3 additions and 1 deletions

View File

@@ -153,7 +153,7 @@ const EXCLUDED_PROFILE_COLS = new Set(['search_text', 'search_tsv'])
let profileCols: any
const getProfileCols = async () => {
export const getProfileCols = async () => {
if (profileCols) return profileCols
const pg = createSupabaseDirectClient()
const rows = await pg.manyOrNone<{column_name: string}>(

View File

@@ -6,6 +6,7 @@ import * as sqlBuilder from 'shared/supabase/sql-builder'
describe('getProfiles', () => {
beforeEach(() => {
jest.clearAllMocks()
jest.spyOn(profilesModule, 'getProfileCols').mockResolvedValue(null)
})
afterEach(() => {
@@ -77,6 +78,7 @@ describe('loadProfiles', () => {
}
jest.spyOn(supabaseInit, 'createSupabaseDirectClient').mockReturnValue(mockPg)
jest.spyOn(profilesModule, 'getProfileCols').mockResolvedValue(null)
})
afterEach(() => {
jest.restoreAllMocks()