From 1fc05262a765da1b26307b3378d08a79831ee7af Mon Sep 17 00:00:00 2001 From: MsNBBc3R Date: Sun, 20 Sep 2026 18:13:56 +0000 Subject: [PATCH] test(desktop): cover new-session model selection regression Signed-off-by: MsNBBc3R --- .../chatInputModelSelectorRouting.test.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) 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('