test: add tailwind escape test (#2816)

This commit is contained in:
Nate Moore 2022-03-17 11:09:11 -05:00 committed by GitHub
parent 4cfbd402a4
commit 915ab92204
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View file

@ -0,0 +1 @@
<div id="complex" class="w-10/12 2xl:w-[80%]"></div>

View file

@ -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>Im a Tailwind Button!</Button>
<Complex />
</body>
</html>

View file

@ -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