import { test, expect, beforeAll } from 'vitest' import presetTailwind, { TailwindTheme } from '@twind/preset-tailwind' import { Intellisense, createIntellisense, SuggestionAt } from '.' let intellisense: Intellisense beforeAll(() => { intellisense = createIntellisense({ presets: [presetTailwind()], }) }) test('suggestAt html', async () => { const $ = (suggestionAt: Promise) => suggestionAt.then( (result) => result && { ...result, suggestions: result.suggestions.map(({ value }) => value) }, ) await expect( $(intellisense.suggestAt(`
`, 20, 'html')), ).resolves.toMatchSnapshot() await expect( $(intellisense.suggestAt(`
`, 17, 'html')), ).resolves.toMatchSnapshot() await expect( $(intellisense.suggestAt(`
`, 29, 'html')), ).resolves.toMatchSnapshot() await expect( $(intellisense.suggestAt(`
`, 23, 'html')), ).resolves.toMatchSnapshot() await expect( $(intellisense.suggestAt(`
`, 28, 'html')), ).resolves.toMatchSnapshot() })