(api) Add textBubbleContentFormat option

Closes #1111
This commit is contained in:
Baptiste Arnaud
2024-05-23 16:30:56 +02:00
parent 3031d26f03
commit c53ce349af
22 changed files with 155 additions and 37 deletions

View File

@@ -48,6 +48,7 @@ test('API chat execution should work on preview bot', async ({ request }) => {
data: {
isOnlyRegistering: false,
isStreamEnabled: false,
textBubbleContentFormat: 'richText',
} satisfies Omit<StartPreviewChatInput, 'typebotId'>,
})
).json()
@@ -120,6 +121,7 @@ test('API chat execution should work on published bot', async ({ request }) => {
data: {
isOnlyRegistering: false,
isStreamEnabled: false,
textBubbleContentFormat: 'richText',
} satisfies Omit<StartChatInput, 'publicId'>,
})
).json()
@@ -302,6 +304,7 @@ test('API chat execution should work on published bot', async ({ request }) => {
message: 'Hey',
isStreamEnabled: false,
isOnlyRegistering: false,
textBubbleContentFormat: 'richText',
} satisfies Omit<StartChatInput, 'publicId'>,
}
)
@@ -317,4 +320,19 @@ test('API chat execution should work on published bot', async ({ request }) => {
},
])
})
await test.step('Markdown text bubble format should work', async () => {
const { messages } = await (
await request.post(`/api/v1/typebots/${typebotId}/preview/startChat`, {
data: {
isOnlyRegistering: false,
isStreamEnabled: false,
textBubbleContentFormat: 'markdown',
} satisfies Omit<StartPreviewChatInput, 'typebotId'>,
})
).json()
expect(messages[0].content.markdown).toStrictEqual('Hi there! 👋')
expect(messages[1].content.markdown).toStrictEqual(
'Welcome. What&#39;s your name?'
)
})
})