File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
packages/tailwindcss-language-server/tests/completions Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 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+ } )
You can’t perform that action at this time.
0 commit comments