mirror of
https://github.com/stablyai/orca.git
synced 2026-09-21 16:02:20 +00:00
test(opencode2): cover live form lifecycle
This commit is contained in:
@@ -149,6 +149,10 @@ describe('OpenCode 2 setup and prompt ordering', () => {
|
||||
type: 'permission.asked',
|
||||
data: { id: 'perm-1', sessionID: 'ses_root', action: 'bash', resources: ['pwd'] }
|
||||
}
|
||||
yield {
|
||||
type: 'permission.replied',
|
||||
data: { id: 'perm-1', requestID: 'perm-1', sessionID: 'ses_root' }
|
||||
}
|
||||
yield {
|
||||
type: 'form.created',
|
||||
data: {
|
||||
@@ -189,6 +193,30 @@ describe('OpenCode 2 setup and prompt ordering', () => {
|
||||
)
|
||||
expect(names).toEqual(expect.arrayContaining(['PermissionRequest', 'MessagePart']))
|
||||
})
|
||||
await vi.waitFor(() => {
|
||||
const names = posts.map(
|
||||
({ body }) => (body.payload as Record<string, unknown>)?.hook_event_name
|
||||
)
|
||||
expect(names).toContain('AskUserQuestion')
|
||||
expect(posts).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
body: expect.objectContaining({
|
||||
payload: expect.objectContaining({
|
||||
hook_event_name: 'AskUserQuestion',
|
||||
sessionID: 'ses_root'
|
||||
})
|
||||
})
|
||||
})
|
||||
])
|
||||
)
|
||||
})
|
||||
await vi.waitFor(() => {
|
||||
const names = posts.map(
|
||||
({ body }) => (body.payload as Record<string, unknown>)?.hook_event_name
|
||||
)
|
||||
expect(names).toContain('SessionIdle')
|
||||
})
|
||||
await cleanup?.()
|
||||
})
|
||||
|
||||
|
||||
+1
-1
@@ -150,7 +150,7 @@ describe('client-hosted screenshot markup', () => {
|
||||
image: backdrop,
|
||||
displayCssWidth: 800,
|
||||
displayCssHeight: 600,
|
||||
['shapes']: []
|
||||
shapes: []
|
||||
})
|
||||
)
|
||||
await waitFor(() => expect(overlay()).toBeNull())
|
||||
|
||||
Reference in New Issue
Block a user