Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
  • Loading branch information
thecrypticace committed Oct 3, 2024
commit d973d6d8d69bf10b70253728d1e043897df6a331
49 changes: 46 additions & 3 deletions packages/tailwindcss/src/intellisense.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,20 @@ test('Can produce CSS per candidate using `candidatesToCss`', () => {

expect(
design.candidatesToCss(['underline', 'i-dont-exist', 'bg-[#fff]', 'bg-[#000]']),
).toMatchInlineSnapshot()
).toMatchInlineSnapshot(`
[
".underline {
text-decoration-line: underline;
}
",
null,
null,
".bg-\\[\\#000\\] {
background-color: #000;
}
",
]
`)
})

test('Utilities do not show wrapping selector in intellisense', async () => {
Expand All @@ -115,7 +128,22 @@ test('Utilities do not show wrapping selector in intellisense', async () => {
}),
})

expect(design.candidatesToCss(['underline', 'hover:line-through'])).toMatchInlineSnapshot()
expect(design.candidatesToCss(['underline', 'hover:line-through'])).toMatchInlineSnapshot(`
[
".underline {
text-decoration-line: underline;
}
",
".hover\\:line-through {
&:hover {
@media (hover: hover) {
text-decoration-line: line-through;
}
}
}
",
]
`)
})

test('Utilities, when marked as important, show as important in intellisense', async () => {
Expand All @@ -130,5 +158,20 @@ test('Utilities, when marked as important, show as important in intellisense', a
}),
})

expect(design.candidatesToCss(['underline', 'hover:line-through'])).toMatchInlineSnapshot()
expect(design.candidatesToCss(['underline', 'hover:line-through'])).toMatchInlineSnapshot(`
[
".underline {
text-decoration-line: underline!important;
}
",
".hover\\:line-through {
&:hover {
@media (hover: hover) {
text-decoration-line: line-through!important;
}
}
}
",
]
`)
})