Home

tailwind-ctp-intellisense @9b9a98f9771c5c44991ca829b3fb98871f130682 - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-language-server / tests / env / multi-config-content.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-content', (c) => {
  test.concurrent('multi-config with content 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 with content 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 } },
    })
  })
})