Skip to content

Commit 3001782

Browse files
Wike-CHIclaude
andcommitted
test(zhipu): add GLM-5 test cases for isInterleavedThinkingModel and isWebSearchModel
Address review feedback from @EurFelux: - Add test cases for glm-5 in isInterleavedThinkingModel - Add test cases for glm-5 in isWebSearchModel - Add edge case tests for glm-5.x versions (should return false) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent aa9c3e9 commit 3001782

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/renderer/src/config/models/__tests__/reasoning.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,6 +2288,20 @@ describe('isInterleavedThinkingModel', () => {
22882288
expect(isInterleavedThinkingModel(createModel({ id: 'GLM-4.5' }))).toBe(true)
22892289
expect(isInterleavedThinkingModel(createModel({ id: 'Glm-4.6-Pro' }))).toBe(true)
22902290
})
2291+
2292+
it('should return true for glm-5', () => {
2293+
expect(isInterleavedThinkingModel(createModel({ id: 'glm-5' }))).toBe(true)
2294+
})
2295+
2296+
it('should return true for glm-5 with suffixes', () => {
2297+
expect(isInterleavedThinkingModel(createModel({ id: 'glm-5-pro' }))).toBe(true)
2298+
expect(isInterleavedThinkingModel(createModel({ id: 'glm-5-lite' }))).toBe(true)
2299+
})
2300+
2301+
it('should return false for glm-5.x versions', () => {
2302+
expect(isInterleavedThinkingModel(createModel({ id: 'glm-5.0' }))).toBe(false)
2303+
expect(isInterleavedThinkingModel(createModel({ id: 'glm-5.1' }))).toBe(false)
2304+
})
22912305
})
22922306

22932307
describe('Non-matching models', () => {

src/renderer/src/config/models/__tests__/websearch.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@ describe('websearch helpers', () => {
227227
providerMock.mockReturnValueOnce(createProvider({ id: 'zhipu' }))
228228
expect(isWebSearchModel(createModel({ id: 'glm-4-air' }))).toBe(true)
229229

230+
providerMock.mockReturnValueOnce(createProvider({ id: 'zhipu' }))
231+
expect(isWebSearchModel(createModel({ id: 'glm-5' }))).toBe(true)
232+
233+
providerMock.mockReturnValueOnce(createProvider({ id: 'zhipu' }))
234+
expect(isWebSearchModel(createModel({ id: 'glm-4.5' }))).toBe(false)
235+
230236
providerMock.mockReturnValueOnce(createProvider({ id: 'dashscope' }))
231237
expect(isWebSearchModel(createModel({ id: 'qwen-max-latest' }))).toBe(true)
232238

0 commit comments

Comments
 (0)