test(web): wait for the transcript the subagent golden pins
CI captured `- text: Loading history…` where the golden holds the grandchild's first message. The only wait before that capture is the offline banner, which renders from the descriptor and says nothing about the transcript below it, and `captureStableAria` calls two identical polls stable — two of which can both be the loading placeholder on a loaded machine. Waiting for the message the golden asserts makes the precondition match the assertion. The race is not observable here (the history is already loaded when the banner appears, so the wait returns in ~1ms), so this is reasoned from the CI log and the helper's semantics rather than from a local reproduction; if the history instead never arrives on CI, the lane now times out on the missing message rather than committing a loading placeholder to the diff.
This commit is contained in:
@@ -31,6 +31,8 @@ const ONE_SHOT_LABEL = 'event-sourcing reviewer'
|
||||
const NESTED_LABEL = 'example editor'
|
||||
const PARENT_PROMPT = 'Ask a research subagent to explain event sourcing.'
|
||||
const INITIAL_PROMPT = 'Explain event sourcing in one sentence.'
|
||||
/** The grandchild's own first message; its arrival is what says its history finished loading. */
|
||||
const NESTED_PROMPT = 'Give one concrete event sourcing example.'
|
||||
const FOLLOWUP = 'Now give the same explanation to a human reader.'
|
||||
const POST_FORK_FOLLOWUP = 'Continue the original conversation after the fork.'
|
||||
|
||||
@@ -176,7 +178,7 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
seq: 1,
|
||||
time: authoredAt + 1,
|
||||
data: {
|
||||
content: [{ type: 'text', text: 'Give one concrete event sourcing example.' }],
|
||||
content: [{ type: 'text', text: NESTED_PROMPT }],
|
||||
source: { kind: 'user' },
|
||||
},
|
||||
surfaceOp: 'append',
|
||||
@@ -404,6 +406,11 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
)
|
||||
await nestedRow.click()
|
||||
await page.getByText('The parent session is offline; reopen it to continue sending messages.').waitFor()
|
||||
// The offline banner renders from the descriptor alone, so it says nothing
|
||||
// about the transcript below it. The golden pins that transcript, and
|
||||
// `captureStableAria` calls two identical polls stable — including two of
|
||||
// "Loading history…". Wait for the message the golden asserts.
|
||||
await page.getByText(NESTED_PROMPT).waitFor()
|
||||
const hierarchy = page.getByRole('navigation', { name: 'Session hierarchy' })
|
||||
const crumbs = await hierarchy.getByRole('button').allTextContents()
|
||||
expect(crumbs.slice(-2)).toEqual([LABEL, NESTED_LABEL])
|
||||
|
||||
Reference in New Issue
Block a user