Skip to content

Commit e8fe386

Browse files
committed
Move test
1 parent 128aafa commit e8fe386

File tree

2 files changed

+52
-37
lines changed

2 files changed

+52
-37
lines changed

packages/tailwindcss/src/compat/config.test.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,3 +1719,55 @@ test('The theme() function does not try indexing into strings', async () => {
17191719
"
17201720
`)
17211721
})
1722+
1723+
test('camel case keys are preserved', async () => {
1724+
let compiler = await compile(
1725+
css`
1726+
@tailwind utilities;
1727+
@theme {
1728+
--color-blue-green: slate;
1729+
}
1730+
@config "./plugin.js";
1731+
`,
1732+
{
1733+
loadModule: async () => {
1734+
return {
1735+
base: '/',
1736+
path: '',
1737+
module: {
1738+
theme: {
1739+
extend: {
1740+
backgroundColor: {
1741+
lightGreen: '#c0ffee',
1742+
},
1743+
},
1744+
},
1745+
},
1746+
}
1747+
},
1748+
},
1749+
)
1750+
1751+
expect(
1752+
compiler.build([
1753+
// From CSS
1754+
'bg-blue-green', // should be output
1755+
'bg-blueGreen', // should not
1756+
1757+
// From JS config
1758+
'bg-light-green', // should not be output
1759+
'bg-lightGreen', // should be
1760+
]),
1761+
).toMatchInlineSnapshot(`
1762+
".bg-blue-green {
1763+
background-color: var(--color-blue-green);
1764+
}
1765+
.bg-lightGreen {
1766+
background-color: #c0ffee;
1767+
}
1768+
:root, :host {
1769+
--color-blue-green: slate;
1770+
}
1771+
"
1772+
`)
1773+
})

packages/tailwindcss/src/index.test.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5935,43 +5935,6 @@ describe('`@property` polyfill', async () => {
59355935
}"
59365936
`)
59375937
})
5938-
5939-
// TODO: Move test into compat folder
5940-
it('camel case keys are preserved', async () => {
5941-
await expect(
5942-
compileCss(
5943-
css`
5944-
@tailwind utilities;
5945-
@theme {
5946-
--color-blue-green: slate;
5947-
}
5948-
@config "./plugin.js";
5949-
`,
5950-
['bg-lightGreen', 'bg-blue-green', 'bg-blueGreen'],
5951-
{
5952-
loadModule: async () => {
5953-
return {
5954-
base: '/',
5955-
path: '',
5956-
module: {
5957-
theme: {
5958-
extend: {
5959-
backgroundColor: {
5960-
lightGreen: '#c0ffee',
5961-
},
5962-
},
5963-
},
5964-
},
5965-
}
5966-
},
5967-
},
5968-
),
5969-
).resolves.toMatchInlineSnapshot(`
5970-
".bg-lightGreen {
5971-
background-color: #c0ffee;
5972-
}"
5973-
`)
5974-
})
59755938
})
59765939

59775940
describe('feature detection', () => {

0 commit comments

Comments
 (0)