@@ -21,12 +21,6 @@ const hoisted = vi.hoisted(() => ({
2121 rateLimit : vi . fn ( ) ,
2222 afterResponse : vi . fn < ( task : ( ) => Promise < void > ) => void > ( ) ,
2323 recordActivity : vi . fn ( ) ,
24- statusMessages : {
25- LIVE_MORE_RANKED_BELOW_MESSAGE : 'More matches ranked below.' ,
26- LIVE_DATE_ORDER_MESSAGE : 'Date order covers retrieved results.' ,
27- LIVE_NOT_STARTED_MESSAGE : 'Not searched before the deadline.' ,
28- LIVE_OVER_ACCOUNT_LIMIT_MESSAGE : 'Not searched: over the account limit.' ,
29- } ,
3024} ) )
3125vi . mock ( '@/lib/core/utils/after-response' , ( ) => ( { afterResponse : hoisted . afterResponse } ) )
3226vi . mock ( '@/lib/knowledge/mcp/activity' , ( ) => ( {
@@ -51,8 +45,8 @@ vi.mock('@/lib/api/server/routes/v2-json-route', () => ({
5145 ...apiServerRoutesMock ,
5246 v2RateLimits : { publicApi : { enforce : hoisted . rateLimit } } ,
5347} ) )
54- vi . mock ( '@/lib/sim-search/live/application' , ( ) => ( {
55- ...hoisted . statusMessages ,
48+ vi . mock ( '@/lib/sim-search/live/application' , async ( importOriginal ) => ( {
49+ ...( await importOriginal < typeof import ( '@/lib/sim-search/live/application' ) > ( ) ) ,
5650 searchLiveKnowledge : { execute : hoisted . liveSearch } ,
5751 readLiveDocument : { execute : hoisted . liveRead } ,
5852} ) )
@@ -62,6 +56,12 @@ vi.mock('@/lib/knowledge/application/chat', () => ({
6256
6357import { OrchestrationError } from '@/lib/core/orchestration/types'
6458import { createKnowledgeMcpServer } from '@/lib/knowledge/mcp/server'
59+ import {
60+ LIVE_DATE_ORDER_MESSAGE ,
61+ LIVE_MORE_RANKED_BELOW_MESSAGE ,
62+ LIVE_NOT_STARTED_MESSAGE ,
63+ LIVE_OVER_ACCOUNT_LIMIT_MESSAGE ,
64+ } from '@/lib/sim-search/live/application'
6565import type { ResolvedSecretTraceRegistry } from '@/executor/utils/resolved-secret-trace-registry'
6666
6767const mocks = hoisted
@@ -235,12 +235,10 @@ describe('live organization Search MCP', () => {
235235
236236 it ( 'states each repeated account status once and flags the entries that carried it' , async ( ) => {
237237 create ( )
238- const {
239- LIVE_MORE_RANKED_BELOW_MESSAGE : moreBelow ,
240- LIVE_DATE_ORDER_MESSAGE : dateOrder ,
241- LIVE_NOT_STARTED_MESSAGE : deadline ,
242- LIVE_OVER_ACCOUNT_LIMIT_MESSAGE : overLimit ,
243- } = mocks . statusMessages
238+ const moreBelow = LIVE_MORE_RANKED_BELOW_MESSAGE
239+ const dateOrder = LIVE_DATE_ORDER_MESSAGE
240+ const deadline = LIVE_NOT_STARTED_MESSAGE
241+ const overLimit = LIVE_OVER_ACCOUNT_LIMIT_MESSAGE
244242 const emptyPage = 'No readable matches on this page.'
245243 const unconnected = 'No connection with this provider is configured.'
246244 mocks . liveSearch . mockResolvedValueOnce ( {
0 commit comments