Skip to content

Commit cd24981

Browse files
committed
Add tests for color presentations
1 parent 91fe9bc commit cd24981

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

packages/tailwindcss-language-server/tests/colors/presentation.test.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ withFixture('basic', (c) => {
105105
{ label: 'bg-[hsl(0,100%,50%)]' },
106106
])
107107
})
108+
109+
test.concurrent('arbitrary oklch color', async ({ expect }) => {
110+
let textDocument = await c.openDocument({ text: '<div class="bg-[oklch(44.05%_0.16_303)]">' })
111+
let res = await c.sendRequest('textDocument/colorPresentation', {
112+
color: { red: 1, green: 0, blue: 0, alpha: 1 },
113+
textDocument,
114+
range: {
115+
start: { line: 0, character: 12 },
116+
end: { line: 0, character: 39 },
117+
},
118+
})
119+
120+
expect(res).toEqual([])
121+
})
108122
})
109123

110124
withFixture('v4/basic', (c) => {
@@ -211,4 +225,18 @@ withFixture('v4/basic', (c) => {
211225
{ label: 'bg-[hsl(0,100%,50%)]' },
212226
])
213227
})
228+
229+
test.concurrent('arbitrary oklch color', async ({ expect }) => {
230+
let textDocument = await c.openDocument({ text: '<div class="bg-[oklch(44.05%_0.16_303)]">' })
231+
let res = await c.sendRequest('textDocument/colorPresentation', {
232+
color: { red: 1, green: 0, blue: 0, alpha: 1 },
233+
textDocument,
234+
range: {
235+
start: { line: 0, character: 12 },
236+
end: { line: 0, character: 39 },
237+
},
238+
})
239+
240+
expect(res).toEqual([])
241+
})
214242
})

0 commit comments

Comments
 (0)