Home

tailwind-ctp-intellisense @4f09c885f122e45dbb3a7c3e8b1c177b267bcdde - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-language-server / tests / env / multi-config.test.js
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { test, expect } from 'vitest'
import { withFixture } from '../common'

withFixture('multi-config', (c) => {
  test.concurrent('multi-config 1', async () => {
    let textDocument = await c.openDocument({ text: '<div class="bg-foo">', dir: 'one' })
    let res = await c.sendRequest('textDocument/hover', {
      textDocument,
      position: { line: 0, character: 13 },
    })

    expect(res).toEqual({
      contents: {
        language: 'css',
        value:
          '.bg-foo {\n  --tw-bg-opacity: 1;\n  background-color: rgb(255 0 0 / var(--tw-bg-opacity));\n}',
      },
      range: { start: { line: 0, character: 12 }, end: { line: 0, character: 18 } },
    })
  })

  test.concurrent('multi-config 2', async () => {
    let textDocument = await c.openDocument({ text: '<div class="bg-foo">', dir: 'two' })
    let res = await c.sendRequest('textDocument/hover', {
      textDocument,
      position: { line: 0, character: 13 },
    })

    expect(res).toEqual({
      contents: {
        language: 'css',
        value:
          '.bg-foo {\n  --tw-bg-opacity: 1;\n  background-color: rgb(0 0 255 / var(--tw-bg-opacity));\n}',
      },
      range: { start: { line: 0, character: 12 }, end: { line: 0, character: 18 } },
    })
  })
})