Browse Source

test: align merged suites with master's cancel cause and optional welcome

workspace-context's abort-tool test uses agent.cancel({kind:'user'}) (master's
AgentCancelCause shape); tui-demo forwards no welcome when none is configured.
Turtle 2 months ago
parent
commit
dfd1eeeadb

+ 1 - 1
packages/context/workspace-context/tests/workspace-context.spec.ts

@@ -1699,7 +1699,7 @@ describe('dynamic nested workspace context injection', () => {
         description: 'Abort the current test step.',
         description: 'Abort the current test step.',
         parameters: {},
         parameters: {},
         async execute() {
         async execute() {
-          ;(agent as unknown as { currentAbort?: AbortController }).currentAbort?.abort('test abort')
+          agent.cancel({ kind: 'user' })
           return [{ type: 'text', text: 'aborted' }]
           return [{ type: 'text', text: 'aborted' }]
         },
         },
       }))
       }))

+ 2 - 1
packages/examples/tui-demo/tests/tui-agent.spec.ts

@@ -88,7 +88,8 @@ describe('dsh-tui-demo app', () => {
     })
     })
 
 
     expect(calls[2]?.config).toEqual({ root: './.sessions' })
     expect(calls[2]?.config).toEqual({ root: './.sessions' })
-    expect(calls[4]?.config).toEqual({ welcome: 'ready.', sessionId: 'persisted-session' })
+    // No configured welcome forwards none: the TUI banner sweeps in without a subtitle.
+    expect(calls[4]?.config).toEqual({ sessionId: 'persisted-session' })
     expect((calls[5]?.config as { agents: Array<Record<string, unknown>> }).agents[0]).toMatchObject({
     expect((calls[5]?.config as { agents: Array<Record<string, unknown>> }).agents[0]).toMatchObject({
       id: 'main',
       id: 'main',
       resumeSessionId: 'persisted-session',
       resumeSessionId: 'persisted-session',