test(native-chat): assert follow-up heading kind, not its copy

This commit is contained in:
Jinwoo-H
2026-11-11 23:57:56 -05:00
parent 8cfca47f97
commit 2afe2c36f2
@@ -63,9 +63,9 @@ it('renders and copies structured mail content without the agent envelope', asyn
})
it.each([
[true, 'Reopened worker'],
[false, 'Sent follow-up to worker']
])(
[true, 'reopened-worker'],
[false, 'followed-up-worker']
] as const)(
'heads a reloaded follow-up start (reopened: %s) as %s, not a started worker',
(reopened, heading) => {
const reloaded: unknown = JSON.parse(
@@ -87,12 +87,10 @@ it.each([
throw new Error('follow-up start item did not survive admission')
}
const message = projectStructuredAgentStartItem(reloaded)
if (!message) {
if (!message?.from) {
throw new Error('follow-up start item did not project')
}
render(card(message))
expect(screen.getByText(heading)).toBeInTheDocument()
expect(screen.queryByText('Started worker')).toBeNull()
expect(agentMessageHeading(message.from, message)).toBe(heading)
}
)