story-kit: merge 196_story_render_code_fences_in_user_chat_messages

This commit is contained in:
Dave
2026-02-25 18:08:08 +00:00
parent 40eeeb8234
commit 91a2daf481
3 changed files with 52 additions and 4 deletions

View File

@@ -1097,9 +1097,13 @@ describe("Remove bubble styling from streaming messages (Story 163)", () => {
]);
});
// findByText returns the styled div itself for user messages (text is direct child)
const userStyledDiv = await screen.findByText("I am a user message");
const styleAttr = userStyledDiv.getAttribute("style") ?? "";
// findByText finds the text element; traverse up to the styled bubble div
const userText = await screen.findByText("I am a user message");
// User messages are rendered via markdown, so text is inside a <p> inside .user-markdown-body
// Walk up to find the styled bubble container
const bubbleDiv = userText.closest("[style*='padding: 10px 16px']");
expect(bubbleDiv).toBeTruthy();
const styleAttr = bubbleDiv?.getAttribute("style") ?? "";
// User messages retain bubble: distinct background, padding, rounded corners
expect(styleAttr).toContain("padding: 10px 16px");
expect(styleAttr).toContain("border-radius: 20px");