mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-07-30 09:48:47 -04:00
Mock database client functions in get-profiles tests to return resolved values; add projection field in test queries; comment out debug log in get-profiles implementation.
This commit is contained in:
@@ -797,7 +797,7 @@ export const loadProfiles = async (props: profileQueryType, db?: SupabaseDirectC
|
||||
}
|
||||
}
|
||||
|
||||
console.debug('profiles:', profiles)
|
||||
// console.debug('profiles:', profiles)
|
||||
|
||||
const countQuery = renderSql(select(`count(*) as count`), ...tableSelection, ...filters)
|
||||
|
||||
|
||||
@@ -75,8 +75,8 @@ describe('loadProfiles', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks()
|
||||
mockPg = {
|
||||
map: jest.fn(),
|
||||
one: jest.fn(),
|
||||
map: jest.fn().mockResolvedValue([]),
|
||||
one: jest.fn().mockResolvedValue(0),
|
||||
}
|
||||
|
||||
jest.spyOn(supabaseInit, 'createSupabaseDirectClient').mockReturnValue(mockPg)
|
||||
@@ -93,6 +93,7 @@ describe('loadProfiles', () => {
|
||||
limit: 10,
|
||||
name: 'John',
|
||||
is_smoker: true,
|
||||
projection: 'full' as const,
|
||||
}
|
||||
|
||||
;(mockPg.map as jest.Mock).mockResolvedValue([])
|
||||
|
||||
Reference in New Issue
Block a user