Skip to content

Commit cebce51

Browse files
committed
Add markdown merging test
1 parent 6c596f5 commit cebce51

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
content: {
4+
value: "markdown1markdown2",
5+
isTrusted: false,
6+
supportThemeIcons: false,
7+
supportHtml: false,
8+
baseUri: undefined
9+
},
10+
kind: "markdownContent"
11+
}
12+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
content: {
4+
value: "markdown1",
5+
isTrusted: false,
6+
supportThemeIcons: false,
7+
supportHtml: true
8+
},
9+
kind: "markdownContent"
10+
},
11+
{
12+
content: {
13+
value: "markdown2",
14+
isTrusted: false,
15+
supportThemeIcons: false,
16+
supportHtml: false
17+
},
18+
kind: "markdownContent"
19+
}
20+
]

src/vs/workbench/contrib/chat/test/common/chatModel.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ suite('ChatModel', () => {
126126
suite('Response', () => {
127127
ensureNoDisposablesAreLeakedInTestSuite();
128128

129-
test('markdown, markdown', async () => {
129+
test('mergeable markdown', async () => {
130130
const response = new Response([]);
131131
response.updateContent({ content: new MarkdownString('markdown1'), kind: 'markdownContent' });
132132
response.updateContent({ content: new MarkdownString('markdown2'), kind: 'markdownContent' });
@@ -135,6 +135,15 @@ suite('Response', () => {
135135
assert.strictEqual(response.asString(), 'markdown1markdown2');
136136
});
137137

138+
test('not mergeable markdown', async () => {
139+
const response = new Response([]);
140+
const md1 = new MarkdownString('markdown1');
141+
md1.supportHtml = true;
142+
response.updateContent({ content: md1, kind: 'markdownContent' });
143+
response.updateContent({ content: new MarkdownString('markdown2'), kind: 'markdownContent' });
144+
await assertSnapshot(response.value);
145+
});
146+
138147
test('inline reference', async () => {
139148
const response = new Response([]);
140149
response.updateContent({ content: new MarkdownString('text before'), kind: 'markdownContent' });

0 commit comments

Comments
 (0)