29 lines
1.5 KiB
TypeScript
29 lines
1.5 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
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', sessionFileExists: true })).toBe('inject')
|
|
})
|
|
|
|
it('resumes the recorded session with the prompt when the tab is closed', () => {
|
|
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, sessionFileExists: false })).toBe('fresh')
|
|
})
|
|
|
|
it('prefers the live terminal even when no session id has been recorded yet', () => {
|
|
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')
|
|
})
|
|
})
|