Skip to content

Commit

Permalink
test: add tests for min-width utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
halvaradop committed Oct 23, 2024
1 parent e60c655 commit 6a21b76
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/tailwindcss-utilities/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,35 @@ describe("scroll utilities", () => {
})
})
})

describe("min-width utilities", () => {
const testCases = [
{
input: `<div class="min-w-sm"></div>`,
output: ".min-w-sm{min-width:640px}",
},
{
input: `<div class="min-w-md"></div>`,
output: ".min-w-md{min-width:768px}",
},
{
input: `<div class="min-w-lg"></div>`,
output: ".min-w-lg{min-width:1024px}",
},
{
input: `<div class="min-w-xl"></div>`,
output: ".min-w-xl{min-width:1280px}",
},
{
input: `<div class="min-w-2xl"></div>`,
output: ".min-w-2xl{min-width:1526px}",
},
]
testCases.forEach(({ input, output }) => {
const extract = input.match(/class="([^"]*)"/)?.[1]
test.concurrent(`generate the css for ${extract}`, async ({ expect }) => {
const css = await generateClasses(input)
expect(css).toMatch(output)
})
})
})

0 comments on commit 6a21b76

Please sign in to comment.