story-kit: merge 196_story_render_code_fences_in_user_chat_messages
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user