Skip to content

Commit

Permalink
also verify error
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-hodgson committed Nov 8, 2024
1 parent 1e40cf4 commit 5648d0c
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,18 @@ describe('SynapseChatInteraction tests', () => {
expect(screen.queryByText('tool-name')).not.toBeInTheDocument()
// html should be removed in 2 ways (by the DOMParser cleanup in SynapseChatInteraction as well as the xss html sanitizer in MarkdownSynapse)
expect(screen.queryByText('<result>')).not.toBeInTheDocument()
expect(screen.queryByRole('alert')).not.toBeInTheDocument()
})

it('Error is shown in an alert', async () => {
const errorMessage =
'Sorry, AI has become uncontrollable and superintelligent leading to human existential risk'
renderComponent({
chatErrorReason: errorMessage,
})

const alertElement = await screen.findByRole('alert')
expect(alertElement).toBeInTheDocument()
expect(screen.queryByText(errorMessage)).toBeInTheDocument()
})
})

0 comments on commit 5648d0c

Please sign in to comment.