()
| 11 | } |
| 12 | |
| 13 | function makeBaseDeps() { |
| 14 | const events: string[] = [] |
| 15 | const deps = { |
| 16 | addNotification: (notification: { |
| 17 | key: string |
| 18 | text: string |
| 19 | priority: 'immediate' |
| 20 | timeoutMs: number |
| 21 | }) => { |
| 22 | events.push(`notify:${notification.key}`) |
| 23 | }, |
| 24 | addToHistory: () => { |
| 25 | events.push('history') |
| 26 | }, |
| 27 | setInputValue: (value: string) => { |
| 28 | events.push(`input:${value}`) |
| 29 | }, |
| 30 | setPastedContents: () => { |
| 31 | events.push('pasted') |
| 32 | }, |
| 33 | setInputMode: () => { |
| 34 | events.push('mode') |
| 35 | }, |
| 36 | setIDESelection: () => { |
| 37 | events.push('ide') |
| 38 | }, |
| 39 | incrementSubmitCount: () => { |
| 40 | events.push('submit:inc') |
| 41 | }, |
| 42 | createAbortController: () => new AbortController(), |
| 43 | getMessages: () => [], |
| 44 | getToolUseContext: () => undefined, |
| 45 | setMessages: () => { |
| 46 | events.push('messages') |
| 47 | }, |
| 48 | setStashedPrompt: () => { |
| 49 | events.push('stash') |
| 50 | }, |
| 51 | setToolJSX: () => { |
| 52 | events.push('tooljsx') |
| 53 | }, |
| 54 | logEvent: (name: string) => { |
| 55 | events.push(`log:${name}`) |
| 56 | }, |
| 57 | addIdleReturnPending: (value: { input: string; idleMinutes: number }) => { |
| 58 | events.push(`idle:${value.input}:${value.idleMinutes}`) |
| 59 | }, |
| 60 | clearIdleHint: () => { |
| 61 | events.push('idle:clear') |
| 62 | }, |
| 63 | getIdleHint: () => false as string | false, |
| 64 | isFullscreenEnvEnabled: () => true, |
| 65 | } |
| 66 | return { deps, events } |
| 67 | } |
| 68 | |
| 69 | describe('dispatchReplSubmitPrelude', () => { |
| 70 | test('short-circuits with the empty background PR notification', async () => { |
no outgoing calls
no test coverage detected