diff --git a/apps/desktop/src/renderer/__tests__/chatInputModelSelectorRouting.test.ts b/apps/desktop/src/renderer/__tests__/chatInputModelSelectorRouting.test.ts index 8ffb4d22694..9d04dc70486 100644 --- a/apps/desktop/src/renderer/__tests__/chatInputModelSelectorRouting.test.ts +++ b/apps/desktop/src/renderer/__tests__/chatInputModelSelectorRouting.test.ts @@ -494,6 +494,29 @@ describe('ChatInput model source switching wiring', () => { ); }); + it('keeps a new conversation model pick on the draft path', () => { + const draftStart = chatInputSource.indexOf('const handleUnifiedDraftSelect = useCallback('); + const draftEnd = chatInputSource.indexOf( + '[sessionId, settingsLocked, modelMemory, onUnifiedDraftSelect]', + draftStart, + ); + const draftHandler = chatInputSource.slice(draftStart, draftEnd); + + expect(draftHandler).toContain('if (sessionId || settingsLocked) return;'); + expect(draftHandler).toContain('onUnifiedDraftSelect?.({'); + expect(draftHandler).not.toContain('maker.setModel('); + expect(draftHandler).not.toContain('confirmModelSwitchContextGuard('); + + const selectorStart = chatInputSource.lastIndexOf('', selectorStart) + 2, + ); + expect(selectorBlock).toContain( + '!sessionId && unifiedPanelActive && onUnifiedDraftSelect\n ? handleUnifiedDraftSelect', + ); + }); + it('feeds the selector the session/draft wire id as the selected model', () => { const selectorStart = chatInputSource.lastIndexOf('