Skip to content

Commit 9b7602e

Browse files
committed
Add test
1 parent ea5c424 commit 9b7602e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { expect, test } from 'vitest'
2+
import { withFixture } from '../common'
3+
4+
withFixture('overrides-variants', (c) => {
5+
async function completion({
6+
lang,
7+
text,
8+
position,
9+
context = {
10+
triggerKind: 1,
11+
},
12+
settings,
13+
}) {
14+
let textDocument = await c.openDocument({ text, lang, settings })
15+
16+
return c.sendRequest('textDocument/completion', {
17+
textDocument,
18+
position,
19+
context,
20+
})
21+
}
22+
23+
test.concurrent(
24+
'duplicate variant + value pairs do not produce multiple completions',
25+
async () => {
26+
let result = await completion({
27+
text: '<div class="custom-hover"></div>',
28+
position: { line: 0, character: 23 },
29+
})
30+
31+
expect(result.items.filter((item) => item.label.endsWith('custom-hover:')).length).toBe(1)
32+
}
33+
)
34+
})

0 commit comments

Comments
 (0)