From 75e54295341e48123208fd739c6059ec8f51b788 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Wed, 22 Apr 2026 08:41:21 +0800 Subject: [PATCH] Test human input submitted markdown fallback --- .../__tests__/submitted.spec.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/web/app/components/base/chat/chat/answer/human-input-content/__tests__/submitted.spec.tsx b/web/app/components/base/chat/chat/answer/human-input-content/__tests__/submitted.spec.tsx index 24960c0837..8bd42c8dfd 100644 --- a/web/app/components/base/chat/chat/answer/human-input-content/__tests__/submitted.spec.tsx +++ b/web/app/components/base/chat/chat/answer/human-input-content/__tests__/submitted.spec.tsx @@ -44,4 +44,18 @@ describe('SubmittedHumanInputContent Integration', () => { expect(screen.getByTestId('submitted-field-answer')).toHaveTextContent('approved') expect(screen.queryByTestId('submitted-content')).not.toBeInTheDocument() }) + + it('should fallback to rendered markdown when structured form data is empty', () => { + render( + , + ) + + expect(screen.getByTestId('submitted-content')).toBeInTheDocument() + expect(screen.getByTestId('mock-markdown')).toHaveTextContent('Rendered **Markdown** content') + expect(screen.queryByTestId('submitted-field-values')).not.toBeInTheDocument() + }) })