🐛 fix(vscode): 别的机器上开的会话在本机没有会话文件时,会话 id 行置灰不可双击,不再 resume 报错
This commit is contained in:
1 parent
2b1e660cc8
commit
bf4661e364
20 files changed
+508
-234
No files matched your search
@@ -3,18 +3,26 @@ import { pickBrainstormContinuePath } from '../../src/panel/brainstormContinue'
|
||||
|
||||
describe('pickBrainstormContinuePath', () => {
|
||||
it('types the prompt into the live terminal when the brainstorm tab is still open', () => {
|
||||
expect(pickBrainstormContinuePath({ liveTerminal: true, sessionId: 'abc' })).toBe('inject')
|
||||
expect(pickBrainstormContinuePath({ liveTerminal: true, sessionId: 'abc', sessionFileExists: true })).toBe('inject')
|
||||
})
|
||||
|
||||
it('resumes the recorded session with the prompt when the tab is closed', () => {
|
||||
expect(pickBrainstormContinuePath({ liveTerminal: false, sessionId: 'abc' })).toBe('resume')
|
||||
expect(pickBrainstormContinuePath({ liveTerminal: false, sessionId: 'abc', sessionFileExists: true })).toBe('resume')
|
||||
})
|
||||
|
||||
it('starts a fresh session when the recorded session has no transcript on this machine', () => {
|
||||
expect(pickBrainstormContinuePath({ liveTerminal: false, sessionId: 'abc', sessionFileExists: false })).toBe('fresh')
|
||||
})
|
||||
|
||||
it('starts a fresh session when the issue has no brainstorm session yet', () => {
|
||||
expect(pickBrainstormContinuePath({ liveTerminal: false, sessionId: undefined })).toBe('fresh')
|
||||
expect(pickBrainstormContinuePath({ liveTerminal: false, sessionId: undefined, sessionFileExists: false })).toBe('fresh')
|
||||
})
|
||||
|
||||
it('prefers the live terminal even when no session id has been recorded yet', () => {
|
||||
expect(pickBrainstormContinuePath({ liveTerminal: true, sessionId: undefined })).toBe('inject')
|
||||
expect(pickBrainstormContinuePath({ liveTerminal: true, sessionId: undefined, sessionFileExists: false })).toBe('inject')
|
||||
})
|
||||
|
||||
it('prefers the live terminal even when the session transcript is not on this machine', () => {
|
||||
expect(pickBrainstormContinuePath({ liveTerminal: true, sessionId: 'abc', sessionFileExists: false })).toBe('inject')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user