Skip to content

Commit c7210de

Browse files
committed
Add markdown blockquote table e2e coverage
1 parent 5a98f31 commit c7210de

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

examples/chat/angular/e2e/fixtures/markdown.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
"match": { "userMessage": "respond with a bullet list" },
1313
"response": { "content": "Three things:\n\n- alpha\n- beta\n- gamma" }
1414
},
15+
{
16+
"match": {
17+
"userMessage": "Give me a blockquote with two lines, then a markdown table with columns issue, expected behavior, verification."
18+
},
19+
"response": {
20+
"content": "> First quoted line\n> Second quoted line\n\n| Issue | Expected behavior | Verification |\n| --- | --- | --- |\n| Blockquote nesting | Both quoted lines render inside one blockquote | Inspect for one `<blockquote>` with no stray quoted paragraph |\n| Table streaming | Rows remain inside the same table while content streams | Inspect for one `<table>` with body rows |\n| Parser recovery | Final DOM has no raw pipe paragraphs | Confirm no paragraph text contains `|` delimiters |"
21+
}
22+
},
1523
{
1624
"match": { "userMessage": "respond with the markdown checklist kitchen sink" },
1725
"response": {

examples/chat/angular/e2e/markdown-surfaces.spec.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,29 @@ test('markdown checklist matrix: rich markdown renders with escaped html', async
5555
await expect(bubble).toContainText("<script>alert('xss')</script>");
5656
});
5757

58+
test('blockquote followed by table stays in one rendered markdown surface', async ({ page }) => {
59+
const bubble = await sendPromptAndWait(
60+
page,
61+
'Give me a blockquote with two lines, then a markdown table with columns issue, expected behavior, verification.',
62+
);
63+
64+
await expect(bubble.locator('blockquote')).toHaveCount(1);
65+
await expect(bubble.locator('blockquote')).toContainText('First quoted line');
66+
await expect(bubble.locator('blockquote')).toContainText('Second quoted line');
67+
await expect(bubble.locator('table')).toHaveCount(1);
68+
await expect(bubble.locator('thead th')).toHaveText([
69+
'Issue',
70+
'Expected behavior',
71+
'Verification',
72+
]);
73+
await expect(bubble.locator('tbody tr')).toHaveCount(3);
74+
await expect.poll(async () => tableColumnsAlign(bubble)).toBe(true);
75+
await expect(
76+
bubble.locator('p').filter({ hasText: /\|/ }),
77+
'table rows should not render as raw pipe paragraphs',
78+
).toHaveCount(0);
79+
});
80+
5881
async function tableColumnsAlign(bubble: Locator): Promise<boolean> {
5982
const table = bubble.locator('table').first();
6083
return table.evaluate((el) => {

0 commit comments

Comments
 (0)