test: add tailwind escape test (#2816)
This commit is contained in:
parent
4cfbd402a4
commit
915ab92204
3 changed files with 11 additions and 0 deletions
1
packages/astro/test/fixtures/tailwindcss/src/components/Complex.astro
vendored
Normal file
1
packages/astro/test/fixtures/tailwindcss/src/components/Complex.astro
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<div id="complex" class="w-10/12 2xl:w-[80%]"></div>
|
|
@ -1,6 +1,8 @@
|
|||
---
|
||||
// Component Imports
|
||||
import Button from '../components/Button.astro';
|
||||
import Complex from '../components/Complex.astro';
|
||||
|
||||
import "../styles/global.css";
|
||||
|
||||
// Full Astro Component Syntax:
|
||||
|
@ -16,5 +18,6 @@ import "../styles/global.css";
|
|||
|
||||
<body>
|
||||
<Button>I’m a Tailwind Button!</Button>
|
||||
<Complex />
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -54,6 +54,13 @@ describe('Tailwind', () => {
|
|||
expect(button.hasClass('lg:py-3'), 'responsive class').to.be.true;
|
||||
expect(button.hasClass('font-[900]', 'arbitrary value')).to.be.true;
|
||||
});
|
||||
|
||||
it('handles complex classes in HTML', async () => {
|
||||
const button = $('#complex');
|
||||
|
||||
expect(button.hasClass('w-10/12'), 'solidus').to.be.true;
|
||||
expect(button.hasClass('2xl:w-[80%]'), 'complex class').to.be.true;
|
||||
});
|
||||
});
|
||||
|
||||
// with "build" handling CSS checking, the dev tests are mostly testing the paths resolve in dev
|
||||
|
|
Loading…
Reference in a new issue