astro/packages/astro/test/astro-slot-with-client.test.js
Chell 50975f2ea3
Fix slot tags uncleaned in HTML String (#6948)
* fix: slot regex

* add slot test

* change set

* add test
2023-05-01 10:49:23 -04:00

25 lines
737 B
JavaScript

import { expect } from 'chai';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
describe('Slots with client: directives', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
before(async () => {
fixture = await loadFixture({ root: './fixtures/astro-slot-with-client/' });
await fixture.build();
});
it('Tags of dynamic tags works', async () => {
const html = await fixture.readFile('/index.html');
const $ = cheerio.load(html);
expect($('script')).to.have.a.lengthOf(1);
});
it('Astro slot tags are cleaned', async () => {
const html = await fixture.readFile('/index.html');
const $ = cheerio.load(html);
expect($('astro-slot')).to.have.a.lengthOf(0);
});
});