Skip to content

Commit 547ce9e

Browse files
fix: 修复 prefetch 测试 — turn-zero 推荐已禁用,测试期望值同步更新
getTurnZeroSearchExtraToolsPrefetch 在 commit 2cf18c4 中被禁用(始终返回 null), 但测试仍期望匹配时返回非 null attachment。更新三个用例全部期望 null。
1 parent 2cf18c4 commit 547ce9e

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/services/searchExtraTools/__tests__/prefetch.runner.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,12 @@ describe('startSearchExtraToolsPrefetch', () => {
149149
})
150150

151151
describe('getTurnZeroSearchExtraToolsPrefetch', () => {
152-
beforeEach(() => {
152+
// Turn-zero user-input tool recommendations are disabled to avoid frequent
153+
// popups. All cases return null regardless of input/match state.
154+
test('returns null (feature disabled)', async () => {
153155
mockGetToolIndex.mockResolvedValue([
154156
{ name: 'index-entry', tokens: ['test'], tfVector: new Map() },
155157
] as never)
156-
mockSearchTools.mockReturnValue([])
157-
})
158-
159-
test('returns non-null attachment for matching tools', async () => {
160158
mockSearchTools.mockReturnValue([
161159
{
162160
name: 'CronCreateTool',
@@ -173,9 +171,7 @@ describe('getTurnZeroSearchExtraToolsPrefetch', () => {
173171
'schedule cron job',
174172
[],
175173
)
176-
expect(result).not.toBeNull()
177-
expect(result!.type).toBe('tool_discovery')
178-
expect((result as Record<string, unknown>).trigger).toBe('user_input')
174+
expect(result).toBeNull()
179175
})
180176

181177
test('returns null for empty input', async () => {

0 commit comments

Comments
 (0)