mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-09 06:55:07 +00:00
feat(cli): update tests
This commit is contained in:
@@ -34,6 +34,14 @@ describe("transformTailwindCss", () => {
|
||||
--background: black;
|
||||
--foreground: white
|
||||
}
|
||||
}
|
||||
@layer base {
|
||||
* {
|
||||
@apply border-border;
|
||||
}
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
}
|
||||
"
|
||||
`)
|
||||
@@ -82,6 +90,74 @@ describe("transformTailwindCss", () => {
|
||||
--foreground: 60 9.1% 97.8%;
|
||||
}
|
||||
}
|
||||
|
||||
@layer base {
|
||||
|
||||
* {
|
||||
|
||||
@apply border-border;
|
||||
}
|
||||
|
||||
body {
|
||||
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
}
|
||||
"
|
||||
`)
|
||||
})
|
||||
|
||||
test("should not add the base layer if it is already present", async () => {
|
||||
expect(
|
||||
await transformTailwindCss(
|
||||
`@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
@layer base{
|
||||
:root{
|
||||
--background: 210 40% 98%;
|
||||
}
|
||||
|
||||
.dark{
|
||||
--background: 222.2 84% 4.9%;
|
||||
}
|
||||
}
|
||||
|
||||
@layer base {
|
||||
* {
|
||||
@apply border-border;
|
||||
}
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
}
|
||||
`,
|
||||
{}
|
||||
)
|
||||
).toMatchInlineSnapshot(`
|
||||
"@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
@layer base{
|
||||
:root{
|
||||
--background: 210 40% 98%;
|
||||
}
|
||||
|
||||
.dark{
|
||||
--background: 222.2 84% 4.9%;
|
||||
}
|
||||
}
|
||||
|
||||
@layer base {
|
||||
* {
|
||||
@apply border-border;
|
||||
}
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
}
|
||||
"
|
||||
`)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user